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.
#33025 by Jsosnowski
Fri Feb 15, 2008 10:03 am
I have been reviewing the examples for D4D provided by DataCad and am not sure I understand several things regarding what DataCad is doing from its side when interacting with the macros in the state machine process.

The main procedure in the primary library unit has a case statement that reads the dcalstate variable. This variable determines which menu of options is active at the time. For discussion, call this MainMenu and lets also say that its only option is F1 which calls Menu2. I am trying to understand the sequence employed by DataCad to operate the macro and interpret the operation as follows:

(Sorry I cannot format the columns better in this forum.)
Cycle | Initial Dcadstate | Control Procedure | act | l.state to datacad | User selection | Iwant (result)

1 | xMainMain | Menu2 | aSize? | 1 | NA | xMain
2 | xMain | MainMenu | Afirst | 1 | F1-(menu2) | xMenu2
3 | xMenu2 | Menu2 | asize | 1? | NA | xMenu2
4 | xMenu2 | Menu2 | afirst | 1 | F4-to do stuff | xMenu2
5 | xMenu2 | Menu2 | aagain | 0 | s0 – exit | XMenu2
6 | xMain?? |

The above describes a process where one menu calls a second one. When we exit the second menu, control should fall back to the first. It appears that DataCad takes the I want value from each cycle through Main and places it in Dcadstate for the next cycle. I do not see where the dcal macro changes the Iwant variable back to xMain, so it looks like DataCad changes it itself. Is DataCad keeping a stack to track control in the macro? If so, is changing l.state to zero the trigger to pop the stack?[/list]
#33483 by Miguel Palaoro
Thu Feb 28, 2008 3:24 pm
Jsosnowski wrote:...(Sorry I cannot format the columns better in this forum.)

Hi Joe,

Try the Code command for the selected text string and you'll get fixed width characters. Like this below.
Note: color feature is not currently available on the command, using the Forum engine. A future improvement might provide this as well.

Code: Select allThe above describes a process where one menu calls a second one.  When we exit the second menu, control should fall back to the first.  It appears that DataCad takes the I want value from each cycle through Main and places it in Dcadstate for the next cycle.


HTH,
Miguel

Who is online

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