[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
STRING String Variable pp 41
Define: An array of characters up to 255 bytes long.
Purpose: Read and Write characters to files and console.
Notes: A variable of type String occupies its length + 1 bytes
in memory. The extra byte is the length byte which is the
first byte of the string. Length byte = Ord (String [0]).
A string 'Constant' is not permanently fixed.
It can be written to and changed up to its defined length.
----------------------------------------------------------------------------
Usage:
CONST
StrVar : String [8] = '1234'; { Define as 8 bytes max }
BEGIN
WriteLn (Ord(StrVar[0])); { The actual length is 4 }
StrVar := '123456789ABC'; { Re-write to 8 bytes max }
WriteLn (Ord(StrVar[0])); { The new length is 8 }
WriteLn (StrVar) ; { '12345678' }
END.
See Also:
Concat
Copy
Delete
Insert
Length
Pos
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson