Temporary Names



next up previous contents
Next: Hand Over Parameters Up: Language Modules for Previous: Macro Questions

Temporary Names

During the interactive work you may see that objects (point, line etc. ) identified with the mouse are entered into the command line directly with their ID.

Since during the creation of geometry the user does not know which sentence number ?? is assigned to the new objects, he has to assign names for the objects within the macros and to reference them later with these names.

If a name is assigned to an object, it keeps this name as long as the name is removed with the command DELETE NAME or another objects receives the same name within the same part.

In general it does not make sense that within the final geometry each point and each line etc. has a name. On the one hand there is too much storage capacity necessary and on the other hand the user does not need the such names after the construction is finished.

For this reason there is a special feature within the macro section with which names can be assigned to elements that can be removed after having finished the macro, so-called temporary names.

Syntax :

       $$string

The string starts with '_' or a-zA-Z and contains other characters out of the range [_a-zA-Z0-9]. The string may in no case be separated with return.

Example:

       CREATE POINT CAR 100,100 ; NA= $$P1 !
       CREATE LINE PP $$P1 ; 200,100!

After the first appearance of the name $$P1 a random name is calculated that does not exist up to this time. This name then is assigned to the point. For any further reference to the name $$P1 the calculated name is used.

After having terminated the macro the command DELETE NAME $$P1 ! automatically applies. After that the random name cannot be referenced any longer. However, it can be seen within KNW. The KNW does not contain the wildcard for the random name $$P1 but the calculated name itself.

It is also possible to assign names to certain elements within a macro, which will keep their name even after the macro is processed.

However, there is a difference between temporary names and fixed names:

If a macro is called from macro level, temporary names for the calling macro below are not known. If, for example, the name $$P1 is used in a submacro, it is a newly defined name, which will be deleted after having finished the submacro.

If, on the contrary, a fixed name P1 is assigned to a point, this name can also be referenced in submacros (although this is not the proper working method, the better way is to use a hand over parameter). If an object with the fixed name P1 is also created within the submacro, the first object becomes unnamed. Any later reference of the name addresses the last object created.



next up previous contents
Next: Hand Over Parameters Up: Language Modules for Previous: Macro Questions




Thu Aug 3 12:51:32 MET DST 1995