omron — PACK program instruction

PACK program instruction PACK program instruction Syntax PACK string_array[ index ], first_char, num_chars = string PACK string_var, first_char, num_chars = string Function Replace a substring within an array of (128-character) string variables, or within a (nonarray) string variable. Parameters string_array String array variable that is modified by the substring on the right-hand side of the equal sign. Each element within the string array is assumed to be 128 characters long (see below). index Optional integer value that identifies the first array element to be considered. The first_char value is interpreted relative to the element specified by this index.

If no index is specified, element zero is assumed. string_var String variable that is modified by the substring on the right- hand side of the equal sign. first_char Real-valued expression that specifies the position of the first character of the substring within the string array. A value of 1 corresponds to the first character of the specified string array element. This value must be greater than zero. The value of first_char can be greater than 128. In that case the array element accessed follows the element specified in the function call. For example, a value of 130 corresponds to the second character in the array element following that specified by index.

num_chars Real-valued expression that specifies the number of characters to be copied from the string to the array. This value can range from 0 to 128. string String variable, constant, or expression from which the substring is to be extracted. The string must be at least num_chars long. eV+Language Reference Guide, v2.x, 18319-000 Rev A Page 381