473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Return codes

how to return code from my app?

like in ol' dos progs

i need to call my app from a batch file and do some things based on the
return code

tnx

Nov 21 '05 #1
3 1401
Environment.ExitCode

Property Value
A 32-bit signed integer containing the exit code. The default value is zero.

Remarks
This property can be used to return a success code from an application. For
example, it can be used to control the execution of a set of applications
invoked in a script. If the value of this property is not set by an
application, zero is returned.
"Nikolay Petrov" <jo******@mail.bg> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
how to return code from my app?

like in ol' dos progs

i need to call my app from a batch file and do some things based on the
return code

tnx

Nov 21 '05 #2
thanks Jim

Nov 21 '05 #3
"Nikolay Petrov" <jo******@mail.bg> schrieb:
how to return code from my app?

like in ol' dos progs

i need to call my app from a batch file and do some things based on the
return code


Add a new module to the project:

\\\
Public Module Program
Public Function Main(ByVal Args() As String) As Integer
For Each Arg As String In Args
MsgBox(Arg)
Next Arg
Application.Run(New MainForm())
If...Then
Return 0
Else
Return 1
...
End If
End Function
End Module
///

Select 'Sub Main' as startup object in the project properties.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Josh Mcfarlane | last post by:
I keep trying to get myself out of the return-code mindset, but it doesn't seem to work. They are suppose to get rid of if-then statements of return codes, but you still have to do an if statement...
16
by: Fao, Sean | last post by:
As far as I can tell, the standard has defined three portable return codes from function main() (0, EXIT_SUCCESS, EXIT_FAILURE). Personally, on all platforms I have worked with, EXIT_SUCCESS is,...
3
by: c# beginner | last post by:
we are trying to standardize return codes across our .NET applications (that are soon to be developed.) What is the best practice for standardizing return codes? I know of only the following...
10
by: Tony | last post by:
I am running an application called AcroComm.exe to poll time clocks here at our company. I have written a small C# app that will poll the clocks based on information found in a DB. My problem is...
1
by: Alex P | last post by:
Hi, i would like to check for a given query (insert, update, delete) if there is a key or constraint violation which prevents the query from being executed. Is such a feature implemented in the...
3
by: RdS | last post by:
Where do I find return codes for MS methods. For instance the filesystemobject methods. I need to know what methods return (error codes, etc. and what they mean). I have searched MSDN and of...
24
by: Earl | last post by:
I have all of my data operations in a separate library, so I'm looking for what might be termed "best practices" on a return type from those classes. For example, let's say I send an update from...
3
by: asearle | last post by:
Hallo everyone, I have a perl script which can return error codes. I have done this with, for example, 'exit 11;', which would (I imagine) send the exit code 11 (instead of 0) back to the calling...
8
by: sloan | last post by:
Does anyone have any good articles on Exception Handing in DotNet. As a "get rid of the API mode of knowing if something worked, we're not in VB6 land anymore Dorothy". I have a few people at...
4
by: barcaroller | last post by:
I am trying to adopt a model for calling functions and checking their return values. I'm following Scott Meyer's recommendation of not over-using exceptions because of their potential overhead. ...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.