| MikeSchinkel |
25th December 2005 02:08 |
validate macro parameters at compile time?
Is it possible to validate macro parameters at compile time? IOW, is there something like an "!ifequal" command and I just can't find it?
Here's an example showing what I'm looking for given the hypothetical !isequal command:
code:
!macro foo _stmt _var1 _op _var2
!define _uid {__LINE__}
!ifequal _op "=" Continue${_uid}
!ifequal _op "<>" Continue${_uid}
!ifequal _op ">" Continue${_uid}
!ifequal _op "<" Continue${_uid}
!error "3rd param must be be one of: =, <>, <, or >."
Continue${_uid}:
...do work here
!undef _uid {__LINE__}
!macroend
|