GetVariableText

(Engine-Level Function)

Description: Returns information about a variable.
Warning: This function should be used only by advanced programmers.
Returns: Numeric
Usage: Script Only.
Function Groups: Compilation and On-Line Modifications,  Variable
Related to: AdjustCode | GetModuleText | GetOneParmText | GetParmText | GetStateText | GetTransitText | SetModuleText | SetOneParmText | SetParmText | SetStateText | SetTransitText | SetVariableText | TextOffset | TextSize
Format: GetVariableText(Variable, Mode)
Parameters:  
Variable
Required. Any expression for a variable.
Mode

Required. Any numeric expression for the desired information. The character offset is to the right after the declared variable (i.e. the carriage return is not included, nor is the line feed that ends the line), and length includes the CR, LF(2).

Mode

Desired information

0

Character offset to variable declaration

1

Size of variable declaration in characters

In the case of the offset to the variable declaration, this is located immediately following the variable preceding this variable and will in fact include the carriage return and line feed from the previous variable. Likewise, the size of the variable declaration includes the leading carriage return and line feed, any spaces preceding the actual variable name and does not include the carriage return and line feed following the variable.

Example:

Assume that the following text is the entire document file for a module:

[
  x;
  y;
  [ (99)
    P1 Module "P1.SRC";
  ]
]
Main [
]

The offsets for the variables would be as follows:

Variable

Offset (Mode = 0)

Size (Mode = 1)

X

1

6

Y

7

6

P1

23

25