Please enable JavaScript to view this site.

A-Shell Reference

Navigation: GDI Printing > Introduction to GDI Printing

Parameters: Symbols vs. Values

Scroll Prev Top Next More

Many GDI printing parameters can be expressed either numerically (in normal base 10 or hex notation), or symbolically, using symbol names that happen to match those used by Windows, as well as being defined in ASHINC:ASHELL.DEF.

Prior to build 945, A-Shell forced you to express all such parameters in base ten numeric format within the print file itself, resulting in GDI commands like the following:

//SETFONT, 120, Arial, 34, 0, 512, 1

Beginning with build 945, you can express those arguments using the hex notation (&h022) or symbolic names as documented with the individual GDI directives. So the above directive could be expressed in any of the following ways:

//SETFONT, 120, Arial, &h022, ANSI_CHARSET, FW_EXTRABOLD,FS_ITALIC

//SETFONT, 120, Arial, VARIABLE_PITCH | FF_SWISS, ANSI_CHARSET, FW_EXTRABOLD,FS_ITALIC

//SETFONT, 120, Arial, variable_pitch | ff_swiss, ansi_charset, fw_extrabold,fs_italic

//SETFONT, 120, Arial, variable | swiss, ansi, extrabold, italic

 

These examples illustrate the following points:

Upper and lower case doesn't matter.
You can use the vertical bar symbol to combine two symbolic values into a single parameter. (This applies only to symbolic names, not to decimal or hex values.)
You can drop the suffixes and prefixes such as _CHARSET, _PITCH, FW_, FS_, etc.

This last point may cause some confusion, since normally symbol names (like variable names) must be precise. If you handle any of these parameters as numeric values (perhaps storing them in numeric variables) then you will want to use the precise symbols as defined in ASHINC:ASHELL.DEF, e.g. FONT'FAMILY = FF_SWISS, since these are interpreted by the compiler, which is not very forgiving. But if you are going to use the symbol names as literal strings in the print file, the A-Shell print formatter will parse them by looking for the "important" parts of the symbol names. Thus, the prefixes and suffixes which are common to all the symbols in a group are ignored and need not be included.

Use of the symbol names rather than the numeric values will make both your programs and the print files themselves easier to understand and therefore to modify.