DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

Linking from one macro to another and returning to 1st macro

Started by Lar, February 28, 2014, 01:05:15 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Lar

Sorry for bothering you guys and gals but I forgot the basiccad statement that runs macro-B from within macro-A and at the end of B returning to A at the spot after it exited, without the "run" or "chain" statement being at the end of macro-B (or if of that capability ever existed)...

Thanks for any help...
Lar

DrollTroll

You can use the CALL statement to call a second macro, and when the second macro ends control returns to the next line of the first macro. However, you'll need to pass any common variables via the SysEx or SysEx$ variables, because the CALLed macro has its own memory space for variables.

If you use CHAIN to call the second macro, then CHAIN back to the first, execution goes back to the beginning of the first macro, and doesn't pick up immediatley after its CHAIN statement.

Finally, you can simply define SUBs in the second file, and use the INCLUDE statement to load those subs as if they were coded directly into the first macro. Call the SUBs using GOSUB and RETURN.
25 years with DesignCAD

prl


prl

Looks like I missed it by 19 seconds.


Lar, here's something interesting.  I have 2149 basiccad programs (some are back copies as I was writing and improving them).  I've never used the Call statement.  Also no gals here.

CliveT

Quote from: prl on February 28, 2014, 01:19:12 PM
  Also no gals here.
Not windy here at the moment also ... oh you mean  gals not gales  :D

Lar

Thanks guys. "Call" was what I was looking for. I remembered run and chain but like DT says they don't return immediately after the exit point.

Lar
ps Prl and Clive: eharmony.com, hotlocals.com, opp.com

prl

Quote from: Lar on February 28, 2014, 04:23:12 PM
ps Prl and Clive: eharmony.com, hotlocals.com, opp.com

Not sure what it is but females don't use DesignCAD or this forum, ever.   Unless they are lurking  . . .

Dr PR

Well, there was one lady on the Forum a while back, but I haven't seen any posts lately.

Definitely a bias in the gender of users here.

Phil
DesignCAD user since 1987

samdavo

Phil
Maybe she misunderstood when you offered to do a line for her. ?

CliveT

Quote from: samdavo on March 03, 2014, 09:56:33 AM
Phil
Maybe she misunderstood when you offered to do a line for her. ?

Or maybe she knew the line belonged to poly  ;)