ID:137492
 
I've #defined a couple macros, TZD and TZD1. The only problem is that when I use TZD1, the TZD part gets replaced by what TZD is defined as, then the numeral "1" gets shoved on the end, which is certainly not what I want. If it's an easy fix to get the compiler to take all the letters wedged between two spaces/punctuations and look for a defined macro before checking for smaller combinations (i.e. looking for TZD1 before TZD), that'd be cool.

I tried making it 1TZD instead of TZD1, but I got inexplicable "bad embedded expression [1TZD]]" errors.

Z
Zilal wrote:
I've #defined a couple macros, TZD and TZD1. The only problem is that when I use TZD1, the TZD part gets replaced by what TZD is defined as, then the numeral "1" gets shoved on the end, which is certainly not what I want. If it's an easy fix to get the compiler to take all the letters wedged between two spaces/punctuations and look for a defined macro before checking for smaller combinations (i.e. looking for TZD1 before TZD), that'd be cool.

I tried making it 1TZD instead of TZD1, but I got inexplicable "bad embedded expression [1TZD]]" errors.

Remember that nodes (et al.) in DM must start with alphabetic characters. Numbers are a definite no-no to start with. =)

I'm not sure, but I think if you define TZD1 *before* TZD it will be parsed first...
In response to Spuzzum
Spuzzum wrote:
Remember that nodes (et al.) in DM must start with alphabetic characters. Numbers are a definite no-no to start with. =)

Macros must be part of the et al, eh?

I'm not sure, but I think if you define TZD1 *before* TZD it will be parsed first...

Actually, I did try that... sadly, no go.

Z

I've #defined a couple macros, TZD and TZD1. The only problem is that when I use TZD1, the TZD part gets replaced by what TZD is defined as, then the numeral "1" gets shoved on the end, which is certainly not what I want.


I can't find a case that produces this behavior. Can you give us a snippet?

--Dan
In response to Dan
Dan wrote:
I can't find a case that produces this behavior. Can you give us a snippet?

--Dan

I would love to, except I have discovered there is no problem. The problem was an errant "1" in the definition of my TZD1 macro... I had checked and double-checked before to make sure everything was spelled right, but I missed it both times. Sorry to make you do the testing!

Z