SETLEN [ HP Business BASIC/XL Reference Manual ] MPE/iX 5.0 Documentation
HP Business BASIC/XL Reference Manual
SETLEN
The SETLEN statement sets the current length of a HP Business BASIC/XL
string variable to a specified length.
Syntax
{TO}
SETLEN str_var {, } num_expr
{; }
Parameters
str_var The variable who length is to be set. A string variable
or a string array element.
num_expr A numeric expression that evaluates to the length of the
string.
An HP Business BASIC/XL program can pass an HP Business BASIC/XL string
as an actual parameter to a Pascal PAC or C array formal parameter, but
only the string characters are passed (the current string length is not).
If the HP Business BASIC/XL program passes the string by reference, and
the Pascal or C external routine changes its current length, then the HP
Business BASIC/XL program must reset the current length when it resumes
control.
Examples
100 EXTERNAL PASCAL INTEGER FNAbbreviate(BYTE A$)
110 INTEGER New_length
120 READ String$
130 New_length = FNAbbreviate(String$) !Calls the function to set
131 !the length
140 SETLEN String$ TO New_length !Sets string to length
141 !returned by FNAbbreivate
150 PRINT String$
999 END
MPE/iX 5.0 Documentation