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.
#58936 by ORWoody
Wed Jan 02, 2013 11:43 am
I would like to work on a little macro for drawing stairs in a straight run. Nothing particularly complex, but one of the variables would be the number of risers. How does one test for repeats for until done in DCAL?
Thanks much,
Woody
#58941 by ORWoody
Wed Jan 02, 2013 2:06 pm
Thanks much for those options. I knew about them as tests, but am not clear on how to re-direct. In basic, I just used a line identifier to force the return to Do/Until. Is the method similar in DCAL?
Thank you,
#58942 by ORWoody
Wed Jan 02, 2013 2:11 pm
Would While work like If in this case? If so, could I then have a sub-routine that just drew the next riser and called the While again?
#58943 by David A. Giesselman
Wed Jan 02, 2013 2:39 pm
You can't call the While loop back from the sub-routine (function). You'd want to do something like:
Code: Select allvar
   Current_Riser : integer;

Current_Riser := 1;
WHILE (Current_Riser <= Num_Risers) DO
   { *** Call your function to draw the riser here *** }
   Current_Riser := Current_Riser + 1;
END;

Dave
#58953 by ORWoody
Thu Jan 03, 2013 12:02 pm
I have a dcs file written out and during DCC1, I end up getting a simple error message in regards to a semicolon being needed to end a statement. For the life of me, I can't find where one is missing. I go to the line identified and search above, but nothing jumps out at me. If there is anyone willing to assist me with this, I would be grateful.
Warning: I am a bit like a cat that has been fed at the back door. Once helped, I continue begging until done. I'd like to be more proficient at DCAL, but can never seem to move beyond the basics on my own.
Thank you,
#58999 by ORWoody
Wed Jan 09, 2013 10:36 am
In order to get the WHILE to work, I assume that it must be part of an independent procedure that initiates the DO for each riser. Would one of you real programmers look at this and tell me why I get an error message indicated for a redefined symbol for Current_Riser : integer?

!--------------------------------------------------------------
PROCEDURE risernum (current_riser, num_risers : IN integer);
VAR
Current_Riser : integer;
BEGIN
Current_Riser := 1;

WHILE (Current_Riser <= Num_Risers) DO
do_sections;
Current_Riser := Current_Riser + 1;
END;
END
END risernum;
!--------------------------------------------------------------

Thank you,

Who is online

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