User Tools

Site Tools


expansion_symbols.htm
Navigation:  Templates > Template Language Reference > Template Symbols > Symbol Overview >====== Expansion Symbols C6H0068.jpg ====== Previous pageReturn to chapter overviewNext page

There are several special symbol forms that expand to allow formatting and special characters to generate into the source. These may be combined with each other to produce complex effects.

%% Expands to a single percent (%) sign. This allows the Application Generator to generate the modulus operator without confusion with any symbol.
%# Expands to a single pound (#) sign. This allows the Application Generator to generate an implicit LONG variable without confusion with any Template Language statement.
%@picture@symbol Formats the symbol with the specified picture when source generates. For example, %@D1@MyDate expands the %MyDate symbol, formatted for the @D1 picture.
%[number]symbol Expands the symbol to fill at least the number of spaces specified. This allows proper comment and data type alignment in the generated source.
% Expands the next generated source onto the same line as the last. This is the Template line continuation character. It is used to split code lines that are too long to fit on the page. In the template files on disk, these characters should not be used to continue a template code line; they are used only for readability.
%'symbol Expands the symbol's string data, “doubling up” single quotes ('), and all un-paired left angle brackets (<;) and left curly braces ({) to prevent compiler errors.
%(expression) Expands the expression into the generated source.

Example:

%(ALL(' ', %indent))%[20]Field %@d3@Date  #!Generate an indent, expand %Field

                                         #!to occupy at least 20 spaces, then

                                         #! generate the date in mmm dd, yyyy format

%[30]Null  #!Generate 30 spaces

#! %MySymbol contains: Gavin's Holiday

StringVar = '%'MySymbol'                  #!Expands as a valid Clarion string constant

                                         #! to 'Gavin''s Holiday'

expansion_symbols.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1