Command else

The else statement is used to specify a condition contrary to the if statement in an POSXML application. Other commands can be used within an else block, and these commands are executed if the logical expression of the if statement is not true.

Example


There are three conditions in the example above:

  • 1st - comparison between two texts resulting in false because Blue is different from the value of the variable sColor;
  • 2nd - comparison between two numbers resulting in false because 111 isn't greater than the value of the variable iNumber;
  • 3rd - comparison between two texts resulting in false because blue is equal to the value of the variable sColor;

POSXML is case-sensitive, so uppercase letters are different than lowercase letters.