Directive (programming): Difference between revisions

Content deleted Content added
m WikiCleaner 0.98 - Repairing link to disambiguation page - You can help!
Line 1:
In [[computer programming]], the term '''directive''' is applied in a variety of ways that are similar to the term ''command'', it is also used to describe some [[programming language]] constructs (e.g. those specifying how a [[compiler]] or [[assembly language|assembler]] should process its input).
 
==Assembly language==
In [[assembly language]], directives generally specify such information as the target platform, mark the separations between [[section]]ssections, and so on. For instance, the commonly seen directive "ALIGN", which inserts in the current section as many [[byte]]s as needed to preserve word-alignment, is generally referred to as a "directive", despite the fact that it does correspond to a particular construct in the generated code.
 
==The C preprocessor==
Line 19:
In [[Turbo Pascal]], directives are called '''significant comments''', because in the language [[grammar]] they follow the same syntax as [[comment (computer programming)|comment]]s. 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 <code>#include "file"</code> directive is the significant comment <code>{$I "file"}</code>.
 
In [[Perl]], the [[keyword (computer programming)|keyword]] "<code>use</code>" can introduce a "pragma", such as <code>use strict;</code> or <code>use utf8;</code>.
 
In [[Visual Basic]], the statement "<code>Option Explicit On</code>" instructs the VB compiler to require all variable declarations before use. There are also a few other variations to the <code>Option</code> keyword, such as: