Directive (programming) - in Other High-level Languages

In Other High-level Languages

In Ada, compiler directives are called pragmas (short for "pragmatic information").

In Turbo Pascal, directives are called significant comments, because in the language grammar they follow the same syntax as comments. In Turbo Pascal, a significant comment is a comment whose first character is a dollar sign and whose second character is a letter; for example, the equivalent of C's #include "file" directive is the significant comment {$I "file"}.

In Perl, the keyword "use" can introduce a "pragma", such as use strict; or use utf8;. ECMAScript also uses this keyword to introduce "pragmas".

In Visual Basic, the statement "Option Explicit On" instructs the VB compiler to require all variable declarations before use. There are also a few other variations to the Option keyword, such as:

  • Option Strict On - Requires that implicit type casts are only to wider types.
  • Option Compare Binary - Tells the compiler to compare text using a binary algorithm.
  • Option Compare Text - Tells the compiler to compare text using a textual algorithm.

Read more about this topic:  Directive (programming)

Famous quotes containing the word languages:

    The very natural tendency to use terms derived from traditional grammar like verb, noun, adjective, passive voice, in describing languages outside of Indo-European is fraught with grave possibilities of misunderstanding.
    Benjamin Lee Whorf (1897–1934)