Show/Hide Toolbars

CatchmentSIM Help

 

When CatchmentSIM reads a macro script (all text after the START-SCRIPT tag) it ignores all space characters except those between double quotation marks (" ").  As a result, blank lines or large spaces can be left to help make code more easily readable by another person.  

Comments can also be included in the text to ease understanding of the script code or flag areas for future consideration.  Comments must be enclosed by curly brackets { }.

It is standard programming practice to indent commands that are embedded within logical operators (eg., LOOP or IF structures).   This further aids to enhance the readability of macro scripts and helps to ensure that right parenthesis of the logical operators are not omitted (these can be hard errors to track down).  An example of the indentation programming practice is shown below (comments are shown in blue).

 

EXAMPLE

 

LOOP(i|1|%Project.DEMRows|
 
   LOOP(j|1|%Project.DEMColumns|
 
      {script commands}
 
   ) {end j loop}
 
) {end i loop}