beautypg.com

General script syntax information, General syntax of a script, Structuring a script – Visara Master Console Center Scripting Guide User Manual

Page 34: General syntax of a script structuring a script

background image

Chapter 3 Script Syntax

Scripting Guide

34

General Script Syntax Information

General Syntax of a Script

The general structure of a script file is as follows:

// comments

// comments

PARMS var1, var2, ..., varN

statement

...

statement

//

comment

RETURN value

Structuring a Script

When writing scripts:

ƒ

Any pre-defined MCC script item (for example, function, command, or
manifest constant) is a reserved keyword.

ƒ

The script compiler is case insensitive except for string literals:

− $MyVariable is the same as $myvariable

− “IEF ERROR MSG” is different from “IEF Error msg”

ƒ

Each part of a multi-part statement must be on a separate line. For
example, the following line is incorrect:

IF (%A < %B) %A := %B ENDIF

It must be split into three lines:

IF (%A < %B)

%A := %B

ENDIF

ƒ

It is not required to assign return values from MCC functions or user
scripts to variables. If a return value is not assigned or is not used in
an expression, it simply disappears. However, ignoring return values
is not good programming.

ƒ

Only one statement is allowed on each line (comments are not
considered statements).

ƒ

The maximum number of characters per line is 2048.

ƒ

The number of lines per script is unlimited.

ƒ

The column starting position of each statement is optional. However,
we strongly recommend following a good program indenting standard
(for example, indenting steps, or IF logic).