Name
$ExtendedSyntax Compiler Directive
Syntax
{$X+} // default
{$ExtendedSyntax On} // default
{$X-}
{$ExtendedSyntax Off}Scope
Local
Description
If
$ExtendedSyntax
is enabled, the compiler extends the
syntax of standard Pascal in a few ways:
The value returned from a function call does not have to be assigned to a variable. Sometimes functions return a result, but the result is not important. Delphi’s extended syntax lets you call the function as though it were a procedure and ignore the function’s result.
Functions can assign a return value to the implicit
Resultvariable.An array of
Charwhose index is an integer type with a zero origin can be treated as a string. The string must be#0terminated. You can also use such an array in any context that calls for aPChartype, and the compiler automatically passes the address of the first element of the array.
Delphi does not have any compiler directives for most of its other
extensions to standard Pascal, but see the
$BoolEval compiler directive for an exception.
See Also
| $BoolEval Compiler Directive, Function Keyword, PChar Type |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access