Compare Function

Description:

Performs a comparison between two string expressions to determine if they are equal or if one is lexicographically less than the other.

Format:

result = COMPARE(expression1, expression2)
result = COMPARE(expression1, expression2, options)

The returned value is:

Parameter:

expression1

A string expression.

expression2

A string expression.

options

Available options are:

NOCASE  Performs a case insensitive comparison 

Example:

integer iResult;

iResult = Compare("One", "Two");
log "Compare(\"One\", \"Two\") = " + ToString(iResult);

iResult = Compare("one", "ONE");
log "Compare(\"one\", \"ONE\") = " + ToString(iResult);

iResult = Compare("one", "ONE", nocase);
log "Compare(\"one\", \"ONE\", nocase) = " + ToString(iResult);

Output:

Compare("One", "Two") = -1
Compare("one", "ONE") = 1
Compare("one", "ONE", nocase) = 0





Go back to the Learning center:


Copyright © AgileLoad. All rights reserved.
Agile Load testing tool| Contact AgileLoad | Terms of Use | Sitemap