Conditionally Displaying Text in XML Gauges
I thought this might be of interest to some people out there:
You can use the %{if}, %{else}, and %{end} constructs to choose which text to display. Note that if, else, and end are case-sensitive and must be typed in lowercase. The syntax for usage is:
%(CONDITIONAL)%{if}TEXT TO DISPLAY IF TRUE%{else}TEXT TO DISPLAY IF FALSE%{end}
For example:
%( 1 )%{if}ON%{else}OFF%{end}
would give the following output:
ON
Whereas the following:
%( 0 )%{if}The value is true%{else}The value is false%{end}
Would yield the following output:
The value is false
NOTE: There must not be a space between the ‘%’ and the ‘{‘.
The if maybe be used without a corresponding else. In this case, if the conditional evaluates to false, no text will be displayed.