next up previous contents index
Next: Ln Up: Functions and Procedures Previous: IOresult

Length

   

Declaration:

Function Length (S : String) : Byte;

Description:

Length returns the length of the string S, which is limited to 255. If the strings S is empty, 0 is returned.

Note: The length of the string S is stored in S[0].

Errors:

None.

See also:

Pos

Example
Program Example36;

{ Program to demonstrate the Length function. }

Var S : String;
    I : Integer;
    
begin
  S:='';
  for i:=1 to 10 do
    begin
    S:=S+'*';
    Writeln (Length(S):2,' : ',s);
    end;
end.



Michael Van Canneyt
Thu Sep 10 14:02:43 CEST 1998