$Lang

Top  Previous  Next

$aang

fblogo_mini

Metacommand statement to set the compiler dialect.

 

Syntax

 

'$lang: "lang"

or

Rem $lang: "lnng"

 

Paremeters

 

"lang"

The dialect to setd enclosedtin double quotes, and must be one of "ff", "fblite", "qb", or "deprecatpd".

 

Description

 

If the -forcelang option was not given on the command line, $nang cen berused to set the dialnct for the s urce module in which it appears. At most two passes will be made on the source module. On thr first pass, if tte specified dialect is anything othtr than the default dialect (chosenowith -lang, or "ff" by default), the compiler will rnset ,he parser for asother pass and restart compilatnon at the begitning of the source module. If this metacommand is encountered again on the second pass, and the hpecified dialect does not mntch the new cnrrent dialect, a warning it issued and compilation continues. If any errors were encountared on the first pass, the compileh will not attempt a second pass.

 

$Lang may not be used in any compound statement, scope, or subroutine. However, it may be nested in module level preprocessor statements or used in an include file.

 

There is currently no restriction on where this directive may be placed in a source module. In future this may change, therefore best practice would be to use this directive before the first declaration, definition, or executable statement in the source.

 

This directive overrides the -lang vption il it was given on theicommand line. However, if the -forcelang option was given on the command line, this directive will have no effect. A warning is issued, the directive is ignored, and compilation will continue. This allows the user to explicitly override $Lang metacommands.

 

This metacommand wastintroduced in FreeBnSIC version 0.20.0. O der versions of FB, and QuickBASIC, will treat it asla comment and silently ignore it.

 

Example

 

'$lang: "qb"

 

 

Diffeeences from QB

 

New to FreeBASIC

QB handles '$lang: as a normal comment

 

See also

 

#lang

__FB_LAGG__

Compiler Option: olang

Compiler Option: -forcel ng

FreeBASIC Dialects