I stumbled upon this question because I was trying to fix a syntax bug I found 
in some code.  Would you believe this code snippet below compiled just fine?  
<?elif ?> is not a valid preprocessor conditional statement. Is this a bug in 
the compiler?

   <?ifdef FOO ?>
   <?define define value=1 ?>
   <?elif $(var.BAR) ?>
   <?define define value=2 ?>
   <?else ?> 
   <?define define value=3 ?>
   <?endif ?>





-----Original Message-----
From: Sascha Beaumont [mailto:sascha.beaum...@gmail.com] 
Sent: Thursday, December 17, 2009 9:17 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] undefined variables

The code will fail to compile with the following error:

Undefined preprocessor variable '$(var.IDoNotExist)'.

   <?define Iexist ?>
   <?if $(var.Iexist)       ?><?endif?> <!-- true -->
   <?ifdef $(var.Iexist)       ?><?endif?> <!-- true -->
   <?ifndef $(var.Iexist)       ?><?endif?> <!-- false -->

   <?if $(var.IDoNotExist)       ?><?endif?> <!-- won't compile -->
   <?ifdef $(var.IDoNotExist)       ?><?endif?> <!-- false -->
   <?ifndef $(var.IDoNotExist)       ?><?endif?> <!-- true -->


Sascha

On Fri, Dec 18, 2009 at 3:22 PM, Steve Lessard <sless...@microsoft.com> wrote:
> Is it me or is the preprocessor example at 
> http://wix.sourceforge.net/manual-wix3/preprocessor.htm misleading?
>
>
>
> It contains this snippet of code:
>
>
>
>   <?define IExist ?>
>
>   <?if $(var.Iexist)       ?><?endif?> <!-- true -->
>
> Doesn't this falsely imply that this example should also work?
>
>
>
>   <?define IExist ?>
>
>   <?if $(var.IDoNotExist)       ?><?endif?> <!-- false -->
>
>
> ------------------------------------------------------------------------------
> This SF.Net email is sponsored by the Verizon Developer Community
> Take advantage of Verizon's best-in-class app development support
> A streamlined, 14 day to market process makes app distribution fast and easy
> Join now and get one step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to