%SUBST built-in function returns a portion of argument string. It may also be used as the result of an assignment with the EVAL operation code.
%SUBST (String, Start {Length})
Required. Must be character. Starting position and length may be any numeric value or numeric expression with zero decimal positions. When the string parameter is of varying length, the values of the other parameters are checked against the current length, not the maximum length.
Required. Represents the starting position of the substring. The starting position must be greater than zero.
Optional. Represents the length of the substring. If it is not specified, the length is the length of the string parameter less the start value plus one. The length may be greater than or equal to zero.
BEGSR Subst_Ex
DclConst Name(City) Value("San Antonio")
ioField1.Text = %Subst (City, 5, 7)
ENDSR