$DECODE string function commas i = i+1 ;Advance the array index UNTIL $string_var == "" ;Stop when input is empty In a case where $string_var contains a sequence of numeric values (as strings) separated by spaces, commas, or any combination of spaces and commas, such as $string_var = "1234. 93465.2, .4358,3458103" executing the above instructions results in the first four elements of the value array having the following values: value[0] = 1234.0 value[1] = 93465.2 value[2] = 0.4358 value[3] = 3458103.0 The string variable input ($string_var) also contains an empty string (""). As shown above, use of the $DECODE function normally involves two string variables:
the input variable and the output variable. If you are interested only in the characters up to the first break character, and want to discard all the characters that follow, the same variable can be used for both input and output. In the following instruction, for example, the same variable is used on both sides of the equal sign because the programmer wants to discard all the white space (that is, space and tab) characters at the end of the input string. NOTE: The break characters are specified by a string expression consisting of a space character and a tab character.
$line = $DECODE($line," "+$CHR(9),0) ;Discard trailing blanks Related Keywords $TRUNCATE string function $MID string function eV+Language Reference Guide, v2.x, 18319-000 Rev A Page 151