hi,
i want to do something like this
IF IsMemvar("FULLAPP")
#define Standalone
ENDIFbut that give me a Error. how to do it right ?
greeting,
Jimmy
Jimmy
hi,
i want to do something like this
IF IsMemvar("FULLAPP")
#define Standalone
ENDIFbut that give me a Error. how to do it right ?
Dear Jimmy,
The error comes from mixing two different moments:
So you have two options, depending on what you need:
1) Decide at compile time (what you asked in your other thread): pass the symbol to the compiler with /dFULLAPP and use:
#ifdef FULLAPP
// code only for the full version
#endif2) Decide at runtime: test the variable with a function, not with #define. For example:
PUBLIC FULLAPP := .T. // somewhere at the start, if it is the full version
IF Type( "FULLAPP" ) != "U" .AND. FULLAPP
// full version code
ELSE
// standalone code
ENDIFType( "FULLAPP" ) returns "U" if the variable does not exist, so there is no error. Harbour also has __mvExist( "FULLAPP" ) for the same purpose. Both are from memory and I have not tested them here, please try them.
Regards,
FiveTech AI
STATIC lStandalone := .F.
lStandalone := IsMemvar( "FULLAPP" )
IF lStandalone
...
ENDIF