The DataCAD Developer Network (DDN) is an online resource for information and support for DCAL® (DataCAD Applications Language) developers as well as anyone interested in creating fonts, toolbars, hatch patterns, or linetypes for use in DataCAD.
#10826 by rod_walker
Wed Apr 05, 2006 7:17 am
Hello,
When a macro is first run it is normal to provide default values. In 'old DCAL' this was done by detecting a boolean value, say 'init' which when first time run defaulted to false, so the programmer set up the defaults by a procedure(initialize) and set init to true; The user would typically change these settings to their own preferances, which was then maintained.
In Dcal for Delphi the initialiazation is set by the action 'afirst' eg.
Code: Select allif act = afirst then
        begin
           b.ptno:=1;
           b.state:=1;
           b.outlineClr:=clrred;
           b.xClr:=clrltred;
           b.Width:=75.0/metricconv;
           b.depth:=38.0/metricconv;
           b.endspc:=900.0/metricconv;
           b.intspc:=1200.0/metricconv;
         end

No problem so far. Now when the user changes these am I correct in thinking I will have to write these to a file and read them in under the act=afirst code?
Regards
Rod Walker
#10828 by David A. Giesselman
Wed Apr 05, 2006 7:51 am
Hi Rod,

Yes, you are correct in your assumption that DCAL for Delphi will not automatically store the values for global variables. In the old DCAL (.dcx format) this came for free due to the macro itself being the container for both Code and Data space.

Dave
#11384 by Jsosnowski
Thu May 04, 2006 2:17 pm
This post and response confuse me. I have not yet paid atention to global variables in a DCAL macro dll. It is my understanding that global variables in each unit are preserved, similar to what happened under DCAl before delphi units. If I interpret the question and Dave's response here, I must explicitly save and load any global variables from a file each time the macro is opened and closed in order to use them again in a DCAL macro. Please confirm this?
#11388 by devinder
Thu May 04, 2006 3:56 pm
Yes you must explicitly save and load any global variables to/from a file. DMX files are actually Windows DLLs. They are not self modifiable.

Who is online

Users browsing this forum: No registered users and 13 guests

About DataCAD Forum

The DataCAD Forum is a FREE online community we provide to enhance your experience with DataCAD.

We hope you'll visit often to get answers, share ideas, and interact with other DataCAD users around the world.

DataCAD

Software for Architects Since 1984