You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Determines if two strings are equal, ignoring case.

Syntax

IsEqual = SRP_String("EQC", 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 two strings are the same, 0 if not.

Remarks

The EQC 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". The EQC service, on the other hand, always does a character by character comparison.

Example

Str1 = "27"
Str2 = "27."

// In BASIC+, these are equal
If Str1 = Str2 then
    Ans = "Equal Value"
end else
    Ans = "Not Equal Value"
end

// Using the Compare service, these strings are not equal
If SRP_String("EQC", Str1, Str2) then
    Ans = "Equal Strings"
end else
    Ans = "Not Equal Strings"
end

// Case insensitive comparison returns 1
Ans = SRP_String("EQC", "HELLO", "hello")

See Also



  • No labels