Scripting Tips


CUBE Voyager

Syntax and Structure:

All statements follow the same general structure:



Some KEYWORDs automatically invoke the associated COMMAND

KEYWORDs are always followed by an equal sign and a VALUE

The VALUE may be the result of an expression or computation

E.g.:  

Continuation characters (commas, equals signs, any operator) distribute statements across multiple lines

    E.g.:

Inputs and Outputs Syntax


Expressions

Operators:


+            addition                                          ||                         logical OR
-             subtraction                                    &&                       logical AND
*            multiplication                                ==, =                    equals
/             division                                           !=, <>                  does not equal
%           modulus                                          >=                        greater than or equal to
^                           exponentiation               <=                        less than or equal to
()            parentheses                                   >                           greater than
                                                                        <                           less than

Numeric functions:
ABS, INT, ROUND, MAX, MIN, EXP, LN, LOG, POW, SQRT, RAND, RANDOM, RANDSEE

Trigonometric functions:
COS, ARCCOS, SIN, ARCSIN, TAN, ARCTAN, …

Special functions:

CmpNumRetNum(V1,OP,V2,R1,R2) = compare V1 with V2 through OP (Operator) and return R1 if true or R2 if false

Commands used in all modules

Job Script Editor

Generated Script Files

Window Layout

Code Assistant

Autocomplete

Hint: {+Cntr+space to show catalog keys

Comments

Example:

                             A=1       ;command followed by comment

                                           ;comment line here

                             A=1 /* comments start here…

                              …

                              … comments end here */

                            B=2

    Hint: Include plenty of comments for yourself and others

Print File Output – PRINTO

The print file must be specified as below:

The variable to be printed must be stated as below:

              Where w = variable total width and d = decimal digits

 

Good to know:

"\n"— new line control

"\f" — new page control

"\t" — tab control

"\\" — ignore new line control

Markers

 

Tip: Put Markers in big scripts for referencing.

Indentation

Indentation makes the script more readable

Status on Task Monitor

Break Scripts into Subsequent Steps

Aggregate COMP Statements

"_" Underscore Temporary Variables