Setting default subscripts¶
setcol |
Set the system variable sys.Col |
setrow |
Set the system variable sys.Row |
setplane |
Set the system variable sys.Plane |
setdim4 |
Set the system variable sys.Dim4 |
Contents
SYNTAX
Set the values of the system variables sys.Col, sys.Row, sys.Plane and sys.Dim4.
These variables store the current default subscript for array fields, which may have up to four dimensions.
Arrays with a single dimension: The default subscript is stored in sys.Row and set by the setrow command.
Multi-dimensional arrays: If a field has more than one dimension, these rules are followed:
Dimension¶
The default subscript is stored in sys.Col and set by the setcol command.
The default subscript is stored in sys.Row and set by the setrow command.
The default subscript is stored in sys.Plane and set by the setplane command.
The default subscript is stored in sys.Dim4 and set by the setdim4 command.
The value of the variables may be set by direct assignment, or by using the related commands.
The commands set the variables according to the value of int_expression, as follows:
int_expression |
Effect |
preceded by + |
Increments variable by the value of int_expression. |
preceded by - |
Decrements variable by the value of int_expression. |
no sign |
Sets variable to the value of int_expression, unless this evaluates to zero, in which case increments variable by 1. |
unqualified command |
Increments variable by 1. |
When a program loads each variable has an initial value of 1.
The current values of the default subscript variables are used if no subscript is explicitly specified when a field in a dimensioned array is referenced.
Since Sculptor version 6.2.0 their value may be 0, when the four variables are set to 0, a whole field array copy may be done at once, see assigning two field arrays. Note that when setting one of the above system variables to a value != 0, and accessing then an array field, the rest is automatically initialised to 1. Meaning that you’ll have to reset the four of them again to 0 if you want the whole array to be copied.
Wrapping¶
The system variable sys.IndexWrap, which may be set to ON or OFF, determines whether wrapping should occur on the elements of subscripted fields. If sys.IndexWrap is OFF, then a subscript which is out of the range for the index referred to causes a null value to be referenced. If it is ON, then subscripts are wrapped modulus their dimension in the same way as textboxes.
The default for sys.IndexWrap is OFF.