Determines if the first string is less than the second string.

Syntax

IsLessThan = SRP_String("LT", String1, String2)

Parameters

ParameterDescription
String1One of the two strings to be compared. (REQUIRED)
String2The other string to be compared. (REQUIRED)

Returns

Returns 1 if the String1 is less than String2 or 0 if String1 is greater than or equal to String2.

Remarks

Added in 2.2.6

The LT service compares two variables as strings. When you use the BASIC+ equality operator, the variables' contents will be compared according to abstract value, which means "123" will be equal to "123.000" instead of less than. The LT service, on the other hand, always does a character by character comparison.

Example

Str1 = "27"
Str2 = "27."

// BASIC+ returns 0
IsLessThan = (Str1 < Str2)

// The LT service returns 1
IsLessThan = SRP_String("LT", Str1, Str2)

// Case comparison returns 1 (lowercase is less than uppercase)
IsLessThan = SRP_String("LT", "hello", "HELLO")

See Also



  • No labels