×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
On 2011/6/29 10:11 PM, John Yeung wrote:
... I've always gotten
an icky feeling with /copy, but I suppose it's no worse than
#include-ing C header files. (Not that I'm too happy with #include.)
It's yet another place where the program is scattered about, another
piece to maintain. We'll see how it goes.
I've heard others have icky feelings about /copy, and I think it usually
stems from disliking the practice of copying in calculations.
But /copy is very useful for defining constants, data structures,
prototypes etc, anything that should be defined the same everywhere.
For example, say you have some action codes: 'DEL', 'ADD', 'UPD'. All
your programs can just code those literals, but if someone codes 'DLT'
by mistake, things won't work well.
Instead, you could these constants in a /copy file, and then never code
the literals again. Then if someone codes ACTION_DLT by mistake, the
compiler will catch it.
D ACTION_DEL C 'DEL'
D ACTION_ADD C 'ADD'
D ACTION_UPD C 'UPD'
Again, it's a bit more work to set it up, and maybe a bit more work to
add a new action code than just to start using the new 'XYZ' code, but
you save time in the long run, both in coding and maintenance.
(Hoping I'm not pressing my luck "lecturing" you again so soon, John,
but you raised another interesting topic.)
As an Amazon Associate we earn from qualifying purchases.