Hi Freaks
As we all know, one can define precompiler constants manly in the define-trigger but also elsehere in code.
Now I thougt about a tricky "programming"
Undefine (or define empty) a constant as an flag in define-trigger
Elsewhere in code redfine this constant with a value like "1"
At the end of compiling catch this constant flag and do somthing with the information
DEFINE-trigger
#define CC_FLAG
e.g. LPMX-trigger
#define CC_FLAG 1
last-trigger?
#if ('<CC_FLAG>'='1')
#warning at least on trigger fires FLAG
#endif
putitem/id $A_INSTANCE_INFO$,"FLAG","<CC_FLAG>"
Actualy I don't know a trigger which is always compile at least.
And "worse", do such a trigger hold proccode?
Background (an example)
I do compile instance-infos into a component local variable which can be read at runtime.
In ths variable there are such things as timestamps or a flag, that a programm is declared "obsolete"
Now I want to catch "dubious" parts of the program. A programm should set a #define flags at the point where code is dubious.
This information should then go into the component local variable at the end of proccode
That are all onyl example of this kind of pre-compile programming.
Any idea if such trigger exists 🙂
Ingo
PS:
Okay, I can define an include with set the information.
But this looks dirty as this are not macros with parameters
#define debuios = WhatsGoingOnHere
#include SetDubious
With macros this looks like
#macro SetDubious(WhatsGoingOnHere)
Where the dine looks like:
#definemacro SetDubious(a_string)
putitem/id $A_INSTANCE_INFO$,"DUBIOS","<a_string>"
#enddefinemacro