Use
Assigns a value of an expression to a name.
Command Syntax
LET name = expression
where:
-
name
- Is the name of any variable or destination construct (such as a substring or based reference in PL/I) that occurs in the source
language program
-
expression
- Can be any expression allowed by the source language whose value can be converted to the data type of the named variable.
You can also assign a hexadecimal literal constant to a variable with an X, XN, Z, A or E expression. For example:
L FCD_ORGANIZATION = '01'x
Example
In this example, the value of MAXV is assigned a new value (MAXV/ 2).
CodeWatch> EVALUATE MAXV
MAXV = 10 {fixed binary (31))
CodeWatch> LET MAXV = MAXV/2
CodeWatch> EVALUATE MAXV
MAXV = 5 [fixed binary (31))
Description
The LET command assigns a value of an expression to a name. When the expression is evaluated, appropriate type conversions are performed. The resultant value is assigned to the named variable. If the type conversion is illegal, the debugger will issue an error message.
The value of a character string constant can be changed by enclosing the expression within single or double quotation marks, depending on the source language.
In C, assignments are merely expression operators with side effects. Therefore, Evaluate provides the same functionality as Let in other languages.
Breakpoints are disabled during function calls using the LET command. If you want a breakpoint in a called routine to be incurred, use the CALL command.
The SUBSTR and LENGTH built-ins may be applied to variable references as part of LET.
In the above example, the Widechar and Graphic strings correspond to the ASCII string ‘978’. For Graphic, codepage of 932 - SHIFT-JIS – Japanese is assumed. For each, Evaluate without /hex will print the “raw” Widechar or Graphic value to the terminal window.