return "error" code from standalone compile

matthias_livecode_150811 at m-r-d.de matthias_livecode_150811 at m-r-d.de
Thu Dec 10 03:25:46 EST 2020


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 at 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 | jacque at hyperactivesw.com
> HyperActive Software | http://www.hyperactivesw.com
> On December 9, 2020 7:48:10 PM Mark Wieder via use-livecode <use-livecode at 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
>> ahsoftware at gmail.com
>> 
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at 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 at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list