Every application can have its own exit codes, but 0 should always be used for 
success and 1 for error.
Although there are exceptions. The Dos Find command for example returns 1 when 
the search was successfull but nothing was found.


You could use exit codes for example in batch files. The batch file runs a 
program and according to the exit code of that program the batch file executes 
the next command or application or what ever.

The OS is not interested in the exit codes. ;) But maybe the batch file or 
program that executed the other app. 
I am using this feature for example in some of my LC app where i execute a 3rd 
party command line tool using shell().  'The result' then contains  the exit 
code. Important: If the exit code is 0 then 'the result' is empty. 

Here are some links with some more information

Windows
http://www.chebucto.ns.ca/~ak621/DOS/ExitCode.html

Linux
https://shapeshed.com/unix-exit-codes/

macOS
https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/sysexits.3.html



Regards,
Matthias

-
Matthias Rebbe
Life Is Too Short For Boring Code

> Am 10.12.2020 um 05:51 schrieb J. Landman Gay via use-livecode 
> <use-livecode@lists.runrev.com>:
> 
> I don't know much about this but it looks interesting. Is there a list of 
> exit codes somewhere? When the OS receives the exit code, what happens? I.e., 
> how would I use it?
> --
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software | http://www.hyperactivesw.com
> On December 9, 2020 7:48:10 PM Mark Wieder via use-livecode 
> <use-livecode@lists.runrev.com> wrote:
> 
>> On 12/9/20 5:32 PM, Douglas A. Ruisaard via use-livecode wrote:
>>> On the completion of a stack, can the compiled executable return an error
>>> code like the old DOS ErrorLevel value(s)?  If so, how do you specify the
>>> error code?  in the on closeStack call?
>> 
>> See the quit command in the dictionary.
>> 
>> quit 42
>> 
>> --
>> Mark Wieder
>> ahsoftw...@gmail.com
>> 
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription 
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to