Page 1 of 1

datacad memory and variable scope

PostPosted: Mon Apr 18, 2016 12:45 pm
by barak
when i write a dcal, the variables stay constantly in memory.
even for other drawings or after closing the datacad and openning again.

where the values are stored?
how can i store variable that its scope exits in the drawing only.

for example i wrote a program that count from 1 and write at each click the count on the drawing.
but, when i activate the macro in other drawing it continue from the recent count.
and even if i close the datacad. and open new drawing' it continues.

can anyone clears the varibles scope issue for me.
thanks
barak

Re: datacad memory and variable scope

PostPosted: Mon Apr 18, 2016 2:49 pm
by David A. Giesselman
Your variables are stored in the macro (.dcx) file itself. A compiled DCAL macro contains its own data space for the storage of declared variables. If you wish to use drawing-level variables that are persistent across drawing sessions, I would suggest using drawing attributes.

Regards,
Dave