[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] |
Set length of a string.
Source position: line 0
procedure SetLength( |
var S: AStringType; |
Len: Integer |
); |
var A: DynArrayType; |
Len: Integer |
); |
SetLength sets the length of the string S to Len. S can be an ansistring, a short string or a widestring. For ShortStrings, Len can maximally be 255. For AnsiStrings it can have any value. For AnsiString strings, SetLength {\em must} be used to set the length of the string.
In the case of a dynamical array A, setlength sets the number of elements. The elements are numbered from index 0, so the count runs from 0 to Len-1. If Zero is specified, the array is cleared.
None.
|
Returns length of a string. |
Program Example85; { Program to demonstrate the SetLength function. } Var S : String; begin FillChar(S[1],100,#32); Setlength(S,100); Writeln ('"',S,'"'); end.
lazarus-ccr.sourceforge.net |