English

How To: Use AML variables with TEXTSTYLE TYPESET

Summary

Variables are useful for parameters and values that are used in multiple places of an aml. This will not only simplify your aml but it will make it easier to maintain. Rather than changing each instance of a parameter or value, you would just change the variable definition. Variables used to display text strings when TEXTSTYLE has been set to TYPESET require special handling, as described below.

Procedure

Example:

To display the number and notation 118° on the screen, without variables, you would use the syntax:

textset font
textsymbol 3
textstyle typeset
move *
text '118!pat1713;'

You could do the same using a variable:

&s d = 118
textset font
textsymbol 3
textstyle typeset
move *
text '%d%!pat1713;'


This, however, will incorrectly draw %d%° to the screen.

To avoid this, insert the variable string within the [QUOTE] function, and assign a single-quoted semi-colon to a variable and reference it with [UNQUOTE] in the TEXT command:

&s d = 118
&s sc = ';'
textset font
textsymbol 3
textstyle typeset
move *
text [quote %d%!pat1713[unquote %sc%]]


The string 118° will now display correctly on the screen.