aa_macro syntax 
 aa_macro source 
 HTML source 
 HTML render 
Key

§ 4.92 - [ifelse] Built-In

Mnemonic aid: ifelse for IF match ELSE no match

aa_macro 3.0.147 Beta or later only

 [ifelse]  invocation provides for handling comparisons between strings, integers, and float point numbers. It is much more powerful and flexible than earlier/other comparison operators, and should be preferentially used.


[ifelse istyle=styleName,(estyle=styleName,)(sep=X,)(cond=CONDITION,)value1Xvalue2(XstyleParameter)]

Valid cond values are:

  • ==
  • !=
  • <
  • <=
  • >
  • >=

If sep is not provided, it defaults to a space.

If cond is not provided, it defaults to ==

 [ifelse]  utilizes styles; istyle must be provided. It will be invoked if cond is true.

If estyle is provided, it will be invoked if cond is false. If it is not provided, then if cond is false, nothing happens.

If only value1 and value2 are provided, the invoked style, if any, will not receive any content.

If value1, value2, and styleParameter are provided, the invoked style, if any, will receive the styleParameter.

For an integer comparison to take place, both value1 and value2 must contain nothing but characters in the set -0123456789

For a floating point comparison to take place, both value1 and value2 must contain nothing but digits and symbols in the set -Ee.0123456789

If either of value1 and value2 fail to be evaluated as integers or floating point numbers, or if they evaluate as different types, then they will be compared as strings. To ensure that a number is evaluated as a floating point number, be sure to include the decimal point.


[ifelse istyle=styleName,(estyle=styleName,)(sep=X,)(cond=CONDITION,)value1Xvalue2(XstyleParameter)]
Keyboard Navigation
, Previous Page . Next Page t TOC i Index

Valid HTML 4.01 Loose
 

This manual was generated with wtfm
wtfm uses aa_macro and SqLite
aa_macro uses Python 2.7