Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5d

Application v 5.25a

  

 

Chapter FiveGeneral Functions (continued)

CompareStringsNoCase Function

Overview

The CompareStringsNoCase function compares the value of the characters within two strings and returns a result as less than, equal to, or greater than. The comparison is performed without regard to text case.

Syntax/Parameters

Syntax

int = CompareStringsNoCase ( string a, string b );

Parameters

a

A string to compare.

b

A string to compare.

Return Value

Returns an int value as:

-1if a < b
0if a == b
1if a > b

Remarks

The CompareStringsNoCase function combines the basic comparison operators (== < and >) to allow string comparison in a single operation. The function compares a and b on a character by character basis without regard to text case. Therefore, “dog” is equal to “DOg”. If all characters match up between the strings up to the matching terminating /0 character, the return result is 0. If any character mismatches, the comparison is stopped and -1 or 1 is returned depending on whether the character in a is less than the character at the same position in b.

The case comparison is performed using the ANSI/ISO-8859-1 character set. Strings made up of other character sets will not compare correctly.

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic