Sets the length of a string variable.
SetLen ( sVariable, lLength )
The SetLen procedure syntax has the following parts:
Name |
Type |
Description |
sVariable |
Var String or Var BString |
String variable to be modified |
lLength |
Long |
New length of string variable |
This function sets the number of characters in the string variable. Setting the length ensures that the string buffer is adequate for input tasks (reading). If the new length is less than the current length, the string value will be truncated to the new length. Nonprintable characters as well as spaces are counted.
s: string
{
SetLen (s, 100)
FileRead (file, s, 100)
}