Next: Standards and Tips Up: Language Modules for Previous: Temporary Names

## Hand Over Parameters for Macros

The above macro questions can be given their settings immediately after calling them. For this purpose the parameter PARM within the RUN command applies.

PARM is set with a constant text (i.e. a text between '"'' ).

The string between inverted commas serves as an answer to the macro question within the macro. You may assign as many hand over parameters as you like to a macro. If the user comes across a question he will put in the next hand over parameter if available. If there is a non-empty parameter, there will be no question but the the text sequence handed over will be placed at the question position.

e.g.:

The macro line.his :

           CREATE LINE PP $ first point : $;200,100!

can be called with

           RUN "line.his" ; "100,100" !    or
           RUN "line.his" ; "XYPOS(P1)" !  etc.

The macro text.his :

           CREATE TEXT L $  startpoint :  $ ;
                         $  textstring :  $ !

can be called with

           RUN "text.his" ; "" ; "'any text'" !

After an input according to the second example the system would ask the question for the starting point, because the first hand over parameter is empty. The created text then would contain 'any text'.

Please note that for the hand over of text constants which are enclosed by single quotation marks, quotation marks are syntactically not correct within a text.
As of version 1.22 it is possible to use a parameter repeatedly by referencing it under its index. The index is the consecutive numbering of the parameter starting with 1 in a row of all parameters of the macros.

e.g.:

           CREATE CIRCLE CTRR IDCTRCIR( $  first circle $ ); NA = circle2 !
           CREATE VARIABLE C $  destination point  $ ; NA = zp !
           MOVE CIRCLE PP $$1 ; IDCTRCIR( $$1 ) ; $$2 !

For this example two parameters were asked for to work with them in the third command with $$1 and $$2.