Arguments (argv variable)
The argv variable is a standard array field provided by the language to pass arguments into a script. It is predefined in all executions of the sil scripts
Where it is used
There may be situations where a single script is used in such a way that the argv variable is truly needed, so you may want to differentiate between calls:
SIL Runner Gadget scripts
Live Fields scripts (DataCenter only)
SIL Scheduler configuration
Listeners
Postfunctions
etc
Refer to each item documentation to see the parameters passed onto the argv variable
How to use it
Just like any other standard field, the argv variable can be called directly in any script. For example, the following script would print all the arguments in the argv variable in the log file.
logPrint("INFO", argv);
Since the argv variable is an array it can also work with index operators:
string firstArg = argv[0];
//or, provided that the invoking protocol defines a map array
string summaryValue = argv["summary"];
Or, since the argv variable is an array it can be iterated over using a loop:
for(string argument in argv) {
//do something with the value of the argument variable
}
Examples
SIL Runner Gadget Example
While it is usually better to use a parameter script to create input fields, generic parameters can be used and passed to the script.