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.
#71964 by Jsosnowski
Mon Jul 31, 2017 7:31 pm
I wrote a test macro which tracks the path and values for the argument 'act' through the menu function and the return value of type 'wanttype' . The menu function includes a 'F1' option for a dummy activity and 'S0' key option for exiting. I discovered that when 'S0' is selected the macro never goes to the action 'alast'. My code for acting on the 'S0' option returns the 'Main' case function result 'wanttype' as 'Xdone' and the macro exits correctly, however, I expected a last loop to call the 'alast' code code section before exiting. The 'wanttype' returned to main is 'xdone' (0). My question is what tells Datacad to enter 'alast' time to perform 'alast' cleanup code?
#71967 by Mark F. Madura
Tue Aug 01, 2017 5:30 am
There are four main sections within DataCAD's state machine.

Section 1: AlSize
This is where DataCAD's state machine allocates memory for your local variables.

Section 2: Afirst
This is where you initialize the local state and other variables. Tasks you
define here will only be performed once.

Section 3: Aagain
This is where DataCAD returns after it has performed an action for you. The
action variable will be equal to Aagain until you set the result to XDone.

Section 4: Alast
If your macro has been interrupted by user action, such as pressing a hotkey,
DataCAD will set the action to Alast to give you the opportunity to clean up any
temporary data before exiting to the new command.
#71969 by Jsosnowski
Tue Aug 01, 2017 8:34 am
Thanks Mark,

I understand the acts but my test macro is not performing an alast loop. As best as I can tell, my menu loop function is written correctly. So my question is what conditions does Datacad look for to invoke the alast act?
#71970 by Mark F. Madura
Tue Aug 01, 2017 8:43 am
Jsosnowski wrote:Thanks Mark,

I understand the acts but my test macro is not performing an alast loop. As best as I can tell, my menu loop function is written correctly. So my question is what conditions does Datacad look for to invoke the alast act?
Press a hotkey that would break you out of the macro and into another menu in DataCAD.

Who is online

Users browsing this forum: No registered users and 7 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