SetLen Procedure

Sets the length of a string variable.

Syntax

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

Comments

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.

Example

s: string

{

SetLen (s, 100)

FileRead (file, s, 100)

}

See Also

Left, Len, Mid, Right, String Data Types, String Literals