Hi.
Is it possible to get a return value other than error level from .net exe? The exe is to be called from a script, batch or rexx.
If not, can you invoke a method in an assembly from batch or rexx and retrieve a return value?
Hi.
Is it possible to get a return value other than error level from .net exe? The exe is to be called from a script, batch or rexx.
If not, can you invoke a method in an assembly from batch or rexx and retrieve a return value?
In C/C++ context It depends on the signature of the main() method. But it is mandatory that the return should be int. So oded's suggestion is worth a try
The entry (and exit) point of any .NET executable is the main method, which has to be a Static method declared with either a void
or int
return type.
For this reason, you cannot directly return anything other than an int
.
This int
value is the error level (by convention, 0 means successful).
You can still in your program write to a "status" file that will allow you to write whatever you want and read from it.