$H or $LONGSTRINGS : Use AnsiStrings

[next] [prev] [prev-tail] [tail] [up]

#### 1.2.25 $H or $LONGSTRINGS : Use AnsiStrings

If {$LONGSTRINGS ON} is specified, the keyword String (no length specifier) will be treated as AnsiString, and the compiler will treat the corresponding variable as an ansistring, and will generate corresponding code. This switch corresponds to the -Sh command line option.

By default, the use of ansistrings is off, corresponding to {$H-}. The system unit is compiled without ansistrings, all its functions accept shortstring arguments. The same is true for all RTL units, except the sysutils unit, which is compiled with ansistrings.

However, the {$MODE} statement influences the default value of {$H}: a {$MODE DELPHI} directive implies a {$H+} statement, all other modes switch it off. As a result, you should always put {$H+} after a mode directive. This behavior has changed, in older Free Pascal versions this was not so.

[next] [prev] [prev-tail] [front] [up]