Documentation Comments
Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.
Reality V15.2 Online Documentation (MoTW) Revision 3
/ command (DataBasic debugger) (m618706+slash.htm)
Displays, and in some cases prompts you to modify, the value of (any part of) a variable, including (where appropriate) a symbol, a particular dimensioned array element, dynamic array field, and substring. Multiple values can also be displayed, but apart from array elements these cannot be modified.
These forms of the / command allow you to display and modify the variables:
{X} / variable-name{<attr#{,value# {,subvalue#}}>} {[start#{,length}]}
{X} / vector-name(row){<attr#{,value# {,subvalue#}}>} {[start#{,length}]}
{X} / vector-name(row)*
{X} / matrix-name(row{,column}){<attr#{,value# {,subvalue#}}>} {[start#{,length}]}
{X} / matrix-name(row{,column})*
These forms of the / command allow you only to display the variables:
{X} / *
{X} / * {V}{D}{E}
{X} / vector-name(start-row)-(end-row)
{X} / matrix-name(start-row{,start-column})-(end-row{,end-column})
This form of the / command allows you to display the symbol value and (where applicable) modify the variable or array element to which it equates (if any):
{X} / symbol-name
variable-nameA simple variable.
vector-nameA one-dimensional array.
matrix-nameA two-dimensional array.
symbol-nameA symbol identifier.
att#Attribute offset.
value#Value offset within an attribute.
sub-value#Sub-value offset within a value.
startSubstring start offset.
lengthLength of a substring (in characters).
rowA row number in a dimensioned array.
columnA column number in a dimensioned array.
start-rowThe first row number of a range of vector or matrix elements.
end-rowThe last row number of a range of vector or matrix elements.
start-columnThe first column number of a range of matrix elements.
end-columnThe last column number of a range of matrix elements.
*When applied to a vector, * displays the whole vector starting at the specified row.
When applied to a matrix, * displays the whole matrix starting at the specified row and column.
On its own, /* displays all the simple variables and dimensioned arrays, unless filtered by V, D or E.
VDisplays all simple variables.
DDisplays all dimensioned arrays (vectors and matrices).
EDisplays all symbol equates.
X Specifies that the display and input will be in hexadecimal. X precedes the command.
For simple variables and arrays, the system displays the value, followed by an equal sign (=
) if the form of the command allows you to modify it. The =
is a prompt to input a new value.
For symbols, the system displays the value and, if it equates to a simple variable or array element, prompts you to enter *
to view that variable or element, which you can then modify if required.
If there is no current value for the variable, the system displays the value as <undefined
>.
If you use a variable name not found in the program, the debugger displays:
Symbol not found.
If you use the / command and did not first compile a symbol table, the following message is displayed:
No symbol table.
Note The / command performs a case-sensitive search of the symbol table for the variable you entered. If a matching entry is found, its value is displayed. Otherwise, it next performs a case-insensitive search:
If only one entry is found, its value is displayed.
If more than one entry is found, the Symbol not found
message is displayed.
At the = prompt, press RETURN to return to the debugger prompt. The value of the variable remains unchanged.
At the = prompt, you can type in a new value for the variable. The new value remains in effect during further program execution until it is assigned a new value by the program. For example:
*/CITY
ROME=PARIS
This command displays the value of variable CITY which is ROME. The value is changed to PARIS by typing the new value after the equals sign.
If you enclose the new value in single or double quotes, these will be removed before assignment to the variable or array element. For example:
*/CITY
ROME="PARIS"
*/CITY
PARIS=
To include the enclosing quotes as part of the value, enclose the value in two pairs of quotes:
*/CITY
ROME=""PARIS""
*/CITY
"PARIS"=
To set a variable or array element to a null string, use just a pair of double or single quotes:
*/CITY
ROME=""
*/CITY
=
Notes
For a dimensioned array, the form of the command determines whether values in the array can be modified, as described above.
Pressing RETURN displays the next element of the array. Press BREAK (CTRL+BREAK on some terminals) to discontinue displaying each array element and to return to the debugger prompt.
If you specify only a single value in the substring specification, it is interpreted as a negative offset and a positive length. For example [6] is equivalent to [-6,6].
The symbol itself cannot be modified, but if the symbol is a symbolic link to a variable or array element, the system prompts you to enter *
to view that variable or element. Once the referenced variable or element is displayed, the usual =
prompt allows you to modify its value.
In the following example the version
symbol equates to the item(1)
vector element whose value is changed from 1 to 2 (as confirmed by displaying both again):
*/version
EQU TO {ITEM(1) } enter '*' to view:*
/ITEM(1) 1=2
*/version
EQU TO {ITEM(1) } enter '*' to view:*
/ITEM(1) 2=¿
*/item(1)
2=¿
If the display is in hexadecimal, any input is assumed to be in hexadecimal. If the display is in character format, any input is assumed to be in character format.
If the display is in character format, a hexadecimal value can be input by typing a (.) followed by the two-character ASCII hexadecimal equivalent of the desired character. The (.) must be typed prior to each hexadecimal character.
Type CTRL+D at the = prompt to redisplay the value in another format. If the display is in hexadecimal, CTRL+D redisplays the value in character format and if the display is in character format, CTRL+D redisplays the value in hexadecimal format.
Any system delimiters contained in a displayed variable are changed to printable characters. All other control characters are converted to tildes (~). Because this conversion also takes place when a statement is executed by single-stepping with the debugger, the display is not interrupted by program-generated cursor control.
*/HOURS
Displays the value of the variable HOURS.
*/ITEM<3,2,1>
Displays the first subvalue in the second value in the third attribute of the dynamic array ITEM.
*/FILES(3,6)<1,4,2>
Displays the second subvalue in the fourth value in the first attribute held in the third row of the sixth column of the dimensioned array FILES.
*/NAME
Displays the value of every element in vector NAME (implicitly starting at the first element).
*/NAME(3)
Displays the value of the third element in the vector NAME.
*/NAME(3)*
Displays the value of every element in the vector NAME, starting at the third element.
*/NAME(3)-(7)
Displays the value of every element in vector NAME, starting at the third element and ending at the seventh element (inclusive) but does not allow you to modify them.
*/GRID
Displays the value of every element in the matrix GRID (implicitly starting at the first element).
*/GRID(4,5)
Displays the value in the fourth row and fifth column in the matrix GRID.
*/GRID(4,5)*
Displays the value of every element in the matrix GRID, starting at the fourth row, fifth column.
*/GRID(4,5)-(8,9)
Displays the value of every element in the matrix GRID, starting at the fourth row and fifth column, and ending at the eighth row and ninth column (inclusive) but does not allow you to modify them.
*/*
Displays the values of all the variables in the program but does not allow you to modify them.