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.
#11772 by Jsosnowski
Tue May 23, 2006 1:03 pm
Here is my read on this. It would be nice if we could get some feedback from DataCAd to confirm this and make any corrections needed. The DCAL manual is for the original DCAL Macro language. IN the revised version for Delphi (D4D) the parameters are changing to accomodate the DLL format. DataCAD calls the dll method "Main" and drives the macro operations based upon the current state. Each time the main method is called it is channeled to a different group of methods. The macro determines what is next by passing a return value (IWant). It appears that DataCad returns the Iwant value in the parameter DCADState in the next loop. The unit UInterfacesRecords identifies a series of record types used as Arguments in the Parg variable. These arguments corespond to a number of routines, such as getpoint, getdistance, getangle, etc..., that get user input from DataCad mouse and keyboard input. I am not quite clear on what exactly distinguishes the need to pass the Parg arguments for these routines rather than accessing other values through DataCad variables/properties such as the current linecolor, linetype etc... In other words, why was it necessary to change the oringal parameters used in calling getpoint to the new ones in D4D?
#11776 by devinder
Tue May 23, 2006 4:20 pm
#11787 by devinder
Wed May 24, 2006 11:36 am
Let us say you as a programmer writes a macro and decide that the return value of main is 4079 at some-point. How should DataCAD rely if 4079 is actually a valid value or not? You might not have defined any case statement for 4079 in you Main routine. DataCAD knows only that it has to look for 'Main' routine in DCAL and the valid range is 4000 to 4099. As long as the range index is valid it will simply make a call to Main routine of the DCAL with 4079, irregardless 4079 exists or doesn't. It is you as a programmer who decides how to handle 4079 case.
In the same way if you call any DataCAD API and DataCAD returns a value and expects you pass it back to DataCAD, it is DataCAD's responsibility on how to handle that value. At this point DataCAD guarantees that the returned value will not be between 4000 and 4099. Any other value returned by DataCAD has some meaning and DataCAD will handle it accordingly. Every-time you will make a call to Getpoint, retval will always be equal to 3. If you change the retval from 3 to some other value, you change the meaning on what has to occur next. That can lead to application crashing.
From my perspective what really is important is what the API does as opposed to what value is returned by the API.
When you call getpoint or getdis or getang or any api that requires input from user, the control of program flow is controlled by DataCAD and not by dcal program. As long as you are making the right call on what to do next , DataCAD will return you the correct value and assumes that you return him the back the correct value.
If you want to prompt a user for the angle, you cannot call getdis and expect DataCAD to return you angle. You will have to call getang. If you make a call to getdis followed by getang immediately, last one overrides the previous one and DataCAD will only make a call to getang. DataCAD can processes only one command at a time.
I might be sounding as if I am rude, but I am not. I am just trying to make it simpler to understand.
#11800 by Miguel Palaoro
Thu May 25, 2006 7:13 am
#11883 by devinder
Wed May 31, 2006 8:10 am

Who is online

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