In this page I have attempted to set out what I perceive to be the advantages and disadvantages of the Classic & Delphi flavours of DCAL, and in the summary at the bottom I outline the sorts of macros that I personally would consider using each for.
Classic Advantages:
- stable development tool that has been in use for about 30 years
- Even today's version is compatible with most old versions of DatatCAD
- Smaller file size compared to equivalent Delphi macro (not really important these days).
- No additional development software required.
Classic Disdvantages:
- will crash if it encounters a polygon or slab entity with more than 40 sides (and won't process more than 36). This is only an issue
if it is being used with DataCAD version 14 or greater.
- I expect that Classic macros will execute more slowly than their Dephi equivalents (I have not verified this, and it will not be an issue for the majority of macros).
- Single precision arithmetic only (will be an issue for some macros, but not important to many others). Single precission discrepancies tend to be more obvious is metric drawings.
- DCAL compiler/linker has not been updated, and will not run in modern 32-bit environments (but can compile using programs such as DOSBox or on a 16 bit Virtual Machine).
Delphi Advantages:
- a good debugger. This is a big advantage imho. (click for instructions on how to set up the
debugger)
- Double Precision Arithmetic
- I expect a Delphi macro to execute faster than its Classic equivalent (I have not verified this, but not an issue for the majority of macros anyway).
- Can handle the large polygons (more than 36 sides) that were introduced with DataCAD 14.
- Access to a few more fields and functionality within DataCAD.
- Easy Access to windows functionity available in Delphi (e.g. vcl forms, clipboard, databases etc.)
Delphi Disdvantages:
- Not as reliable and stable as Classic DCAL. There are a number of funcions that either do not work at all, or else do not work correctly in all
circumstances (do not assume you are doing something wrong just because your macro crashes - there are buggy functions that do not
work and some will cause a crash (e.g. pntinpoly function is faulty in the current version and will crash the macro, lyr_read does
not appear to work, lyr_create works but does not return a valid address, and and mode_group was faulty but fixed in DataCAD 20).
- Lacking equivalents to several Classic DCAL functions (including such basic functionality as getmode).
- DataCAD recommend doing a seperate compile of the macro for each version of DataCAD it is to be used with (using the header files supplied with that version).
In practice I believe that this is not necessary after the first few versions of DCAL for Delphi (macros compiled with the DataCAD 11
header files will definitely not work in later versions, but I have found that macros compiled with the DataCAD 15 header files will
run correctly in later versions of DataCAD).
- I believe it still cannot access DataCAD's 'Smart' entities.
- Need to install Delphi software (although note that Delphi Community Edition is free for many users - subject to revenue restrictions).
Summary:
To me, the big advantages of DCAL for Delphi are the provision of a decent debugger, and it's ability to process the large polygons that were introduced in DataCAD 14. The ability to process large polygons is very important when the user is left to select entities (and you cannot prevent them selecting a large polygon!). Unfortunately, the lack of getmode functionality in DCAL for Delphi means that this is one scenario where you cannot easily implement the selection using DCAL for Delphi. This is an unfortunate Catch22, but the end result is that DCAL for Delphi is
currently not easily able to be used for any macro that wishes to implement the standard selection interface, which is one place where it would otherwise have a big advantage.NOTE: A GetMode procedure was added to DCAL for Delphi in DataCAD v23.00.03.01
If double precision arithmetic or speed of execution are priorities for your macro then DCAL for Delphi is definitely the way to go, or if it is complex and you expect to spend a lot of effort
debugging then DCAL for Delphi is also the way to go. Unfortunately both of the previous statements must be qualified by the condition that the macro does not require the user to select entities from the drawing using the normal selection interface (GetMode). It is probably possible to write your own equivalent, but it will add considerable development effort compared to Classic DCAL.
|