October 2010
Intermediate to advanced
348 pages
7h 10m
English
In this section, we'll take a look at the conditional and looping statements that are available at compile time.
The if statement checks that a preprocessor variable is set to a certain value. If it does, the code between it and the closing endif statement will be compiled. Optionally, it can be followed by an elseif or e
lse statement, allowing you to compile other code if the initial condition is false. The entire block must end with an endif. Here's an example that only compiles a Property element if the preprocessor variable myVar is equal to 10.
<?if $(var.myVar) = 10 ?>
<Property Id="newProperty" Value="5" />
<?endif?>Here's a more complex example that utilizes the elseif and else statements: ...
Read now
Unlock full access