GLBasic forum

Main forum => Bug Reports => Topic started by: MrTAToad on 2010-Feb-28

Title: ?UNDEF in ?IF
Post by: MrTAToad on 2010-Feb-28
It appears that an ?UNDEF command will be executed no matter whether the ?IF command is valid or not.

Eg :

?IFDEF WINCE
   ?WARNING "Compiling for Windows CE"

   ?UNDEF ALLOW_HISCOREUPLOAD
   ?UNDEF ALLOW_PROGRAMUPDATE
   ?UNDEF ALLOW_SCREENRESCHANGE
   ?UNDEF ALLOW_FULLSCREEN

   CONSTANT default_screenWidth%=320
   CONSTANT default_screenHeight%=480
   CONSTANT default_allowWebUpload%=TRUE
   CONSTANT default_useFullScreen%=TRUE
   CONSTANT default_allowProgramUpdate%=TRUE
   CONSTANT defaultResString$="320x480"
?ENDIF

Even though I wasn't compiling for Windows CE, the four ?UNDEF statements were still be processed...
Title: Re: ?UNDEF in ?IF
Post by: FutureCow on 2010-Mar-01
Can't test at the moment, but according to the doco it looks like you should have
Code (glbasic) Select
?IF WINCE and not
Code (glbasic) Select
?IFDEF WINCE
Title: Re: ?UNDEF in ?IF
Post by: Kitty Hello on 2010-Mar-01
Both should be ok. The unfed seems a bug, sorry.
Title: Re: ?UNDEF in ?IF
Post by: MrTAToad on 2010-Mar-01
Yes, both ?IF and ?IFDEF work - the former is used if ?DEFINE has been used with a value.
Title: Re: ?UNDEF in ?IF
Post by: MrTAToad on 2010-Mar-13
It also happens with ?DEFINE too...