$TRUNCATE string function $TRUNCATE string function Syntax $TRUNCATE (string) Function Return all characters in the input string until an ASCII NUL (or the end of the string) is encountered. Parameter string String variable, constant, or expression that specifies the string to be truncated. Details This function is similar to performing a $DECODE operation with an ASCII NUL (^H00) specified as the break character. $TRUNCATE differs from such a $DECODE operation in two ways: l The input can be a string expression. l The input string is not modified. Because of its simplicity, the $TRUNCATE function executes much faster than the $DECODE function.
Example The instruction below sets the value of the string variable $substring equal to abcdef. (Obviously, this is an artificial situation, since one would never want to perform a $TRUNCATE operation when the result is apparent from the input. However, it is presented to illustrate that this function can scan an arbitrary string expression and return the first substring delimited by a NUL.) $substring = $TRUNCATE("abcdef"+$CHR(0)+"ghijk") Related Keyword $DECODE string function eV+Language Reference Guide, v2.x, 18319-000 Rev A Page 549