In some situations, you may wish to define a complex function which cannot be readily implemented using the graphical elements supplied by GoldSim. For example, a particular calculation may require complex conditional logic which would be cumbersome to represent using a Selector element, or it may require a numerical solution technique (e.g., iteration); or perhaps you need to construct an array using complex logic.
The Script element provides a way to specify a sequence of statements directly within the GoldSim interface in order to address complex functions and logic which cannot be easily implemented using the GoldSim graphical elements. Scripts are created by inserting and editing statements or statement blocks, which may be variable definition statements, variable assignment statements, statements controlling the sequence of execution in the script (e.g., loops and if statements), or statements used for writing messages to the Run Log. The Script element sequentially evaluates the specified sequence of locally defined statements to determine its output(s).
To Open the Model File:
- Start GoldSim
- Click on the File and select Open Example...
- Browse to General Examples and select the file called Script.gsm