Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

value comparisons

Status
Not open for further replies.

tbrownch

IS-IT--Management
Aug 6, 2007
2
US
Basic compare of 2 fields does not result in not equal

VALUE1 = "99 USE SIDE DOOR "
VALUE2 = " 99 USE SIDE DOOR"
IF VALUE1 = VALUE2 THEN SAY "VALUES EQUAL"
IF VALUE1 ¬= VALUE2 THEN SAY "VALUES DO NOT EQUAL"

Result VALUES EQUAL, Need to include blanks and treat them as not equal

How can I compare these without having to do a loop like this

VALEQ = 0
DO V = 1 TO RL_LEN.I
V1 = SUBSTR(VALUE1,V,1)
V2 = SUBSTR(VALUE2,V,1)
IF V1 ¬= V2 THEN VALEQ = 1
IF V1 ¬= V2 THEN V = 99
END
IF VALEQ = 0 THEN SAY "VALUES EQUAL"
IF VALEQ = 1 THEN SAY "VALUES DO NOT EQUAL"


 
Check-out "The comparison operators and operations" in the reference manual.
Where you will find
== True if terms are strictly equal (identical)
\==, ¬==, /== True if the terms are NOT strictly equal (inverse of ==)

IF VALUE1 == VALUE2 THEN SAY "VALUES EQUAL"

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top