...
The Parameters field is used to pass values into your SIL™ program. To add a parameter click the Add Parameter button.
Note | |
---|---|
title | Notes
|
...
The parameters will be passed into the program using the argv variable. The values will be available using a construct like argv["parameter_name"] or argv[position]. For the above example, the number of rockets can be retrieved using argv["rockets"] or argv[2]. You can reorder the parameters using drag and drop.
...
Once you run the script, the program console will be displayed.
...
Tip |
---|
You can use the RunnerLog routine to print info in the console as the program runs. Note that the console buffer is limited to 512 lines every ~0.5 sec and the console will only display the latest 512 lines. |
Example code
...
Code Block |
---|
runnerLog("Preparing to start a war..."); runnerLog("Building tanks..."); runnerLog("Built " + argv["tanks"] + " tanks."); runnerLog("Gathering infantry..."); runnerLog("Gathered " + argv["infantry"] + " brave men."); runnerLog("Fueling rockets..."); runnerLog(argv["rockets"] + " ready."); runnerLog("Dispatching orders..."); return "Good job! The world is now at war!"; |
Tip |
---|
TipYou can return as many values as you need, regardless of their type. |