Untitled

(Steven Felgate) #1

to the function's definition. DIESEL macro expressions have only one data
type: strings. Macros that operate on numbers express the numbers as strings
and convert back and forth as required.


For descriptions of the DIESEL functions, see Catalog of DIESEL Functions on
page 331.


Now define a more interesting status line (for example, one that shows the
current text style name):


Command: modemacro
New value for MODEMACRO, or. for none <"">: Style: $(getvar, textstyle)


■ Style: is a text string to be displayed on the status line.


■ $(getvar,textstyle) is a DIESEL function (getvar) and argument that
retrieves the current value of the TEXTSTYLE system variable.


NOTEThe examples in this topic may show the MODEMACRO string as more
than one line of text. You enter it as one long string at the prompt.


You can retrieve any system variable by entering $(getvar, varname). The
current setting of the system variable replaces the macro expression on the
status line. Then, when you switch text styles, for example, MODEMACRO is
reevaluated. If it changes, the new text style name is displayed on the status
line.


Expressions can be nested, and they can be as complex as you want. The
example that follows displays the current snap value and angle (in degrees)
in the status line. It uses nested expressions to convert the snap angle from
radians to degrees and truncates the value to an integer.


Command: modemacro
New value for MODEMACRO, or. for none <"">: Snap: $(getvar, snapunit)
$(fix,$(*,$(getvar,snapang),$(/,180,3.14159)))


You can also display the values in the current linear and angular units modes.


Command: modemacro
New value for MODEMACRO, or. for none <"">: Snap: $(rtos,$(index,0,
$(getvar,snapunit))),$(rtos,$(index,1,$(getvar,snapunit))) $(angtos,
$(getvar,snapang))


DIESEL copies its input directly to the output until it comes to the dollar sign
character ($) or a quoted string. You can use quoted strings to suppress
evaluation of character sequences that would otherwise be interpreted as
DIESEL functions. You can include quotation marks in quoted strings by using


Set MODEMACRO Values | 327

Free download pdf