beautypg.com

Variables, Using and naming variables, Character string variables – Visara Master Console Center Scripting Guide User Manual

Page 36

background image

Chapter 3 Script Syntax

Scripting Guide

36

Variables

Using and Naming Variables

ƒ

Variables may be character strings, numerics, or arrays; arrays may
be strings or integers. The first character of a variable name must be
a letter.

ƒ

A variable name can contain letters, numbers, and underscores.

ƒ

A variable name may not contain a dash.

ƒ

All variable names are prefixed with a special character denoting its
type:

$ string
% integer

ƒ

The variable name’s maximum length is 255 characters.

ƒ

The scope of all variables is local to the script in which they are used.

ƒ

Declaring variables is not necessary—they are allocated dynamically.

ƒ

“Deallocation” of variables is not necessary—they are automatically
and properly deallocated when a script ends execution.

Character String Variables

ƒ

Character string variable names are prefixed with a dollar sign “$”.

ƒ

The maximum number of characters per character string is limited
only by available memory.

ƒ

Strings are automatically initialized to “” (empty string).

ƒ

String concatenation is allowed with the + operator.

ƒ

String literals can be delimited by single or double quotes. For
example:

$VarName

$ScanText := “IEF”

$ScanText := ‘IEF’

$All := $First + $Second