$X: Extended Syntax Switch


 $X:  Extended Syntax Switch

Enables or disables Turbo Pascal's extended syntax.

   Syntax:        {$X+} or {$X-}
   Default:       {$X+}
   Type:          Global
   Menu Command:  Options|Compiler|Extended Syntax 

The $X+ State

In the $X+ state, function calls can be used as statements; the result of a function call can be discarded.

Generally, computations performed by a function are represented through its result, so it makes little sense to discard the result. However, in some cases, a function can carry out multiple operations based on its parameters. Some of those cases might not produce a sensible result.

In such cases, the $X+ extensions allow the function to be treated as a procedure.

The $X+ directive does not apply to built-in functions (functions defined in the System unit).

The $X+ mode also enables support for null-terminated strings by activating the special rules that apply to the built-in PChar type and zero-based character arrays. See the Strings unit Help screen for more information.

The $X- State

In the default state, $X-, extended syntax is disabled. Attempting to use it will cause an error.

Тэги: $X
| G+
Код для вставки: :: :: :: ::
Поделиться: // //