Livecode Wiki
No edit summary
Tag: sourceedit
No edit summary
Tag: sourceedit
Line 18: Line 18:
   
 
The arguments are stored by livecode in $1, $2, $3, ... , etc. variables.
 
The arguments are stored by livecode in $1, $2, $3, ... , etc. variables.
'''S#''' return the number of arguments plus one, the name script, stored in '''$0'''.
+
'''S#''' returns the number of arguments plus one, the name script, stored in '''$0'''.

Revision as of 15:53, 11 July 2016

If you don't need the graphic, you can use livecode only as script, just use the option -ui. For example on Linux:

/opt/livecode/livecodecommunity-8.0.0.x86_64/livecodecommunity.x86_64 -ui myScript.livecode

Put your script in the OpenStack message of the main stack of your program.

All data to the standard output are forwarded by put:

put the long date

You the close this stack to end the script, for example:

on OpenStack
  put the long date
  close this stack
end OpenStack

Arguments

You can pass any number of arguments, arguments are space divided after the script name. For example:

livecodecommunity.x86_64 -ui myScript.livecode arg1 arg2

The arguments are stored by livecode in $1, $2, $3, ... , etc. variables. S# returns the number of arguments plus one, the name script, stored in $0.