Difference between revisions of "Shortstring"

From Lazarus wiki
m (Categorised page)
Line 3: Line 3:
 
'''Memory requirement:''' 256 bytes (1 byte for the length specification and 255 bytes for the characters).
 
'''Memory requirement:''' 256 bytes (1 byte for the length specification and 255 bytes for the characters).
 
   
 
   
'''Property:''' The [[Data field|data field]] of the [[Data type|data type]] Shortstring is an array, made up of data fields of the data type [[Char]]. Its length is defined as: <syntaxhighlight lang="pascal" inline>ShortString = String[255];</syntaxhighlight>.
+
'''Property:''' The [[Data field|data field]] of the [[Data type|data type]] Shortstring is an array, made up of data fields of the data type [[Char]]. Its length is defined as: <syntaxhighlight lang="pascal" inline>ShortString = String[255];</syntaxhighlight>
  
 
ShortString has the same properties as the string in Turbo Pascal.
 
ShortString has the same properties as the string in Turbo Pascal.

Revision as of 20:09, 11 October 2020

Deutsch (de) English (en) français (fr)

Memory requirement: 256 bytes (1 byte for the length specification and 255 bytes for the characters).

Property: The data field of the data type Shortstring is an array, made up of data fields of the data type Char. Its length is defined as: ShortString = String[255];

ShortString has the same properties as the string in Turbo Pascal.

Definition of a data field of the data type ShortString:

  var 
    s : ShortString;

Examples for the valid assignment values:

    s := '0123ABCabc456';
    s := s + '! "§ $% & / () =?';
    s := 'c';
    s := s + IntToStr (45);

Examples of invalid assignment of values:

    s := True;
    s := 4;

See also