Hybrid Integration 10.2 | Integrating On-Premises Applications | DSPs and building output templates | Using Dynamic Server Pages (DSPs) | Using the DSP Tags | Conditionally Executing Blocks of Code | Building Conditional Blocks With the %ifvar% Tag
 
Building Conditional Blocks With the %ifvar% Tag
The %ifvar% tag is similar to an “if…then…else” expression in other programming languages. You use it to denote a block of code that is to be executed only when a specified variable exists or contains a value that you specify.
The basic format of the %ifvar% tag is as follows, where variableName specifies the name of the variable that will be evaluated at run time:
%ifvar variableName%
Block of Code
[%else%
Block of Code]
%end%
Example
.
.
.
<!--Check for presence of backordered items in the order -->
<!--and display if they exist -->
%ifvar backItems%
<p>Backordered Items
%loop backItems%
%value%<BR>
%endloop%
%endifvar%

.
.
.

Copyright © 2015- 2018 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
Innovation Release