Hi... I was wondering after reading the FPC documentation on compiler directives, if anyone knew some good tips and tricks regarding macros?
I have some units with TONS (seriously... I doubt (no, make that know!) that I am able to actually measure the weight of bits! ..hehe ) of consts following a pattern of a macro.
...Also, defining stuff with macros could make typing errors harder to accomplish.
example:
const
regV3AD = $13; // pattern here is "+1" on each const
regV3SR = $14;
regFcLo = $15;
regFcHi = $16;
kCtrTest = $08; // pattern here is "shr" on each const
kCtrRing = $04;
kCtrSync = $02;
kCtrGate = $01;
// I would love to be able to do something like:
regV3AD = {$MACRO PATTERN1};
regV3SR = {$MACRO PATTERN1};
regFcLo = {$MACRO PATTERN1};
regFcHi = {$MACRO PATTERN1};
kCtrTest = {$MACRO PATTERN2};
kCtrRing = {$MACRO PATTERN2};
kCtrSync = {$MACRO PATTERN2};
kCtrGate = {$MACRO PATTERN2};
// yeah, you get the point... no, I won't use enums here! ;)
If anyone also have some other good tips on macros, I would love to know...
Thanks