In this example, the value of data items in the SIFT routine is evaluated.
CodeWatch> EVALUATE THIS_PRIME THIS_PRIME = 7 {fixed binary (31))
In this example, a cross section of the array PRIMES from 1 to count -1, where count equals 4, is evaluated.
CodeWatch> EVALUATE PRIMES (1 : count - 1) PRIMES(1) = 1 {fixed binary (31)) PRIMES(2) = 2 {fixed binary (31)) PRIMES(3) = 3 {fixed binary (31))
Description
The EVALUATE command evaluates and prints the value of expressions in the source language program. If the expression is omitted, Evaluate uses the previous expression that was evaluated. If no previous expression was evaluated, an error message generates.
The value of simple variables may be changed using the LET command. Array evaluation and array slice evaluation is also supported.
The display mode is the mode in which the value of the expression is to be printed. The valid display modes are Ascii, Bit, Float, Hex, Integer, and Octal. The display modes are defined in the table below.
For WIDECHAR variable evaluation, half byte-pairs outside the ASCII range display as a '.' character. Use the EVALUATE command with the /h option to display hexadecimal values for each byte-pair. For example:
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.
The SUBSTR and LENGTH built-ins may be applied to variable references as part of EVALUATE.