1.2.33 $X or $EXTENDEDSYNTAX : Extended syntax

Extended syntax allows you to drop the result of a function. This means that you can use a function call as if it were a procedure. By default this feature is on. You can switch it off using the {$X-} or {$EXTENDEDSYNTAX OFF}directive.

The following, for instance, will not compile:

function Func (var Arg : sometype) : longint;  
begin  
...          { declaration of Func }  
end;  
 
...  
 
{$X-}  
Func (A);

The reason this construct is supported is that you may wish to call a function for certain side-effects it has, but you don’t need the function result. In this case you don’t need to assign the function result, saving you an extra variable.

The command line compiler switch -Sa1 has the same effect as the {$X+} directive.

By default, extended syntax is assumed.