CADL: Old Cadkey CAD system language
potatohead
Posts: 10,261
In the 80's and 90's, I always printed off source code. While going through some old papers today, I found the first commercial software program I ever wrote! It was called "EZ-SHAPES", and it ran under a mechanical CAD system called CADKEY. The language was CADL, actually it still is CADL, and I believe these programs would still work on a current version of the software.
There is one seat of this still in use today. It's a pirate, but I was so pleased to see it, I wrote 'em a license on the spot.
Anyway, it used indents and some other basic things in ways similar to SPIN, which I thought familiar when I got my Demo Board long ago. Thought I would share a snippet:
This program presents the user a menu, which they can select items from either the F-keys, or the cursor. The menu presents them with selection choices: all entities on a plane, single entities, everything displayed, and so forth. There is some crude handling for the ESC key, and a BACK / CANCEL key set, which I no longer remember. Having used number constants, I won't either, unless I go do what it takes to run the thing. (I won't)
Once that menu pick is made, a loop not shown grabs all the entity ids into an array, which gets fed to the makecoll command where they are grouped together. Pick one, you pick 'em all kind of thing.
This function was not present in the software UI at the time this program was written, and it was part of a set of utilities that enhanced the CAD, and provided quick and dirty mechanical CAD shape create useful to sheet metal programmers.
They even provided a nice window system, with basic tools like focus and the ability to capture events, but that died off as the DOS version of the program did. I never wrote for that again, but I did continue entity create tools for a while. Anyway, always archive. Kind of fun to see this.
Heh... it had goto.
Funny thing, it had a fair amount of advanced constructs. I wrote to the very basics of the language, none of which saw changes resulting in the programs continuing to work over many revisions. A competetor didn't do this, and let's just say their stuff doesn't run today. Sometimes less is more, I suppose.
Edit: I just read a scribbled note to myself. "A good utility fits on one printed page." Most of them do, but for one that draws a trapazoidal shape. It could have used some consolidation, which I never did. That one is a full two pages. (Man, my writing is complete Smile today! Wasn't then.)
Marketing masters are in this folder too. It seems I used a pen plotter to generate some line art, and something like Wordpad to generate text, then it was old school slice and dice, until the layout looked good and worked on a tri-fold, suitable for mailing. We've come a long way since then. The date on the 3.5" floppy is actually '95. First version was '91, and is lost somewhere on 5.25" floppies.
There is one seat of this still in use today. It's a pirate, but I was so pleased to see it, I wrote 'em a license on the spot.
Anyway, it used indents and some other basic things in ways similar to SPIN, which I thought familiar when I got my Demo Board long ago. Thought I would share a snippet:
COLLECT.CDL local ulong, ids[0] local num, i, etyp :getopt getmenu "Select Entities to be Collective", \ "SINGLE",\ "CHAIN",\ "WINDOW",\ "POLYGON",\ "GROUP",\ "PLANE",\ "ALL DISP" if (@key <= -2) exit if (@key == -1) goto getopt getentm @key, num if (@key <= -2) goto getopt if (@key == -1) goto getopt prompt "Creating Collective " array ids[num] . . . (just didn't want to type it all in) makecoll num, ids exit
This program presents the user a menu, which they can select items from either the F-keys, or the cursor. The menu presents them with selection choices: all entities on a plane, single entities, everything displayed, and so forth. There is some crude handling for the ESC key, and a BACK / CANCEL key set, which I no longer remember. Having used number constants, I won't either, unless I go do what it takes to run the thing. (I won't)
Once that menu pick is made, a loop not shown grabs all the entity ids into an array, which gets fed to the makecoll command where they are grouped together. Pick one, you pick 'em all kind of thing.
This function was not present in the software UI at the time this program was written, and it was part of a set of utilities that enhanced the CAD, and provided quick and dirty mechanical CAD shape create useful to sheet metal programmers.
They even provided a nice window system, with basic tools like focus and the ability to capture events, but that died off as the DOS version of the program did. I never wrote for that again, but I did continue entity create tools for a while. Anyway, always archive. Kind of fun to see this.
Heh... it had goto.
Funny thing, it had a fair amount of advanced constructs. I wrote to the very basics of the language, none of which saw changes resulting in the programs continuing to work over many revisions. A competetor didn't do this, and let's just say their stuff doesn't run today. Sometimes less is more, I suppose.
Edit: I just read a scribbled note to myself. "A good utility fits on one printed page." Most of them do, but for one that draws a trapazoidal shape. It could have used some consolidation, which I never did. That one is a full two pages. (Man, my writing is complete Smile today! Wasn't then.)
Marketing masters are in this folder too. It seems I used a pen plotter to generate some line art, and something like Wordpad to generate text, then it was old school slice and dice, until the layout looked good and worked on a tri-fold, suitable for mailing. We've come a long way since then. The date on the 3.5" floppy is actually '95. First version was '91, and is lost somewhere on 5.25" floppies.