Ax51 User's Guide

Comparison Functions

The MPL comparison functions compare two string arguments and return a value based on the comparison. If the function evaluates to TRUE, the function returns a value of 1. If the function evaluates to FALSE, the function returns a value of 0. The arguments to these functions may contain macro calls (which are expanded before the comparison occurs).

FunctionDescription
%EOS (arg1, arg2)The EOS function compares arg1 and arg2 and returns a value of TRUE if they are identical.
%NES (arg1, arg2)The NES function compares arg1 and arg2 and returns a value of TRUE if they are different.
%LTS (arg1, arg2)The LTS function compares arg1 and arg2 and returns a value of TRUE if arg1 is less than arg2.
%LES (arg1, arg2)The LES function compares arg1 and arg2 and returns a value of TRUE if arg1 is less than or equal arg2.
%GTS (arg1, arg2)The GTS function compares arg1 and arg2 and returns a value of TRUE if arg1 is greater than arg2.
%GES (arg1, arg2)The GES function compares arg1 and arg2 and returns a value of TRUE if arg1 is greater than or equal arg2.

Examples


%EQS (Ax51, Ax51)

The above comparison is FALSE (0). The space after the comma is part of the second argument.


%LTS (Ax51,ax51)

The above comparison is TRUE (1). The lowercase characters have a higher ASCII value than the uppercase characters.


%GTS (10,16)

The above comparison is FALSE (0). These macros compare strings—not numerical values. ASCII character 6 is greater than ASCII character 1.


%GES (ax51,ax51 )

The above comparison is FALSE (0). The space at the end of the second argument makes the second argument greater than the first.


%*DEFINE (VAR1) (Ax51)
%*DEFINE (VAR2) (%VAR1)

%EQS (%VAR1,%VAR2)

The above comparison is TRUE (1). The EQS Macro arguments expand to %EQS(Ax51,Ax51).