Function length (S: String {string; or an array}): integer;
Example:
// String (same as ansistring in Delphi 2007) var S: string; I: integer; begin S: = 'delphi '; I: = length (s ); showmessage (inttostr (I); {6} end;
// Inclustringvar S: inclustring; I: integer; begin S: = 'delphi '; I: = length (s); showmessage (inttostr (I); {6} end;
// String [N] var S: String [10]; I: integer; begin S: = 'delphi '; I: = length (s ); showmessage (inttostr (I); {6} end;
// Ansistringvar S: ansistring; I: integer; begin S: = 'Expect 100'; I: = length (s); showmessage (inttostr (I )); {7} end;
// Widestringvar S: widestring; I: integer; begin S: = 'Expect 100'; I: = length (s); showmessage (inttostr (I )); {5} end;
// Static array (length is the number of elements in the array; sizeof is required to obtain the array size) var I: integer; arr: array [0 .. 10] of integer; begin I: = length (ARR); showmessage (inttostr (I); {11} end;
// Dynamic array var I: integer; arr: array of integer; begin setlength (ARR, 10); I: = length (ARR); showmessage (inttostr (I )); {10} end;
// Multi-dimensional array var I: integer; arr: array [0 .. 4, 2 .. 22] of integer; begin I: = length (ARR); showmessage (inttostr (I); {5} end;
Public Function directory under System Unit