How do I test for in-equality, "A$ <> B$" & "A <> B"...???

How do I test for in-equality, "A$ <> B$" & "A <> B"...???

Postby RBSe » Sun Jul 21, 2013 6:30 pm

Greetings,

:?: How do I test for in-equality, "A$ <> B$" & "A <> B"...???

There must be a work-around but i don't know it.
Any help is much appreciated.

Robert
.
Data is not information, information is not knowledge, knowledge is not understanding, understanding is not wisdom.

Clifford Stoll
User avatar
RBSe
 
Posts: 33
Joined: Wed Mar 06, 2013 7:42 pm
Location: Eureka, California

Re: How do I test for in-equality, "A$ <> B$" & "A <> B"...?

Postby Andries Pretorius » Sun Jul 21, 2013 9:22 pm

Good morning Robert

Please give an example what you want to test for inequality, and for what purpose. Maybe, then we can explore possible options.

Best regards

Andries
Andries Pretorius
 
Posts: 37
Joined: Thu Nov 01, 2012 10:57 am
Location: Johannesburg, South Africa

Re: How do I test for in-equality, "A$ <> B$" & "A <> B"...?

Postby RBSe » Mon Jul 22, 2013 11:22 am

Good Evening your time Andries,

OK, i gather this is not as simple as i thought.
How i was wanting to use it is:

IF x$ <> z$ THEN...
&
IF X <> Z THEN...

:?: Is this what you meant Andries?

Enjoy your evening...

Robert
.
Data is not information, information is not knowledge, knowledge is not understanding, understanding is not wisdom.

Clifford Stoll
User avatar
RBSe
 
Posts: 33
Joined: Wed Mar 06, 2013 7:42 pm
Location: Eureka, California

Re: How do I test for in-equality, "A$ <> B$" & "A <> B"...?

Postby Daniel » Tue Jul 23, 2013 8:40 pm

Hi Robert

Do you want to test if both items are unequal?
Code: Select all
x$="abc"
y$="ac"
x=2
y=3
IF x$<>y$ AND x<>y THEN
    PRINT "both pairs not equal"
ELSE
    PRINT "one pair is equal"
ENDIF
END


works as advertised.

Daniel
Daniel
 
Posts: 91
Joined: Tue Nov 13, 2012 2:10 pm

Re: How do I test for in-equality, "A$ <> B$" & "A <> B"...?

Postby RBSe » Thu Jul 25, 2013 7:56 am

Thanks Daniel,

Nowhere in the manual does it state that "<>" is valid, nor does it show any examples anywhere.

The closest it comes to is in page 18 of the manual where it says:

Valid expressions contain one of the five relational operators =, <, >, <= and >= and variables or constants.


It should also say:
Use "<" and ">" together to test for inequality, example: IF abc$ <> xyz$ THEN...


You can see why i questioned it...

Thanks again for spelling it out Daniel.

Enjoy! 8-)

Robert
.
Data is not information, information is not knowledge, knowledge is not understanding, understanding is not wisdom.

Clifford Stoll
User avatar
RBSe
 
Posts: 33
Joined: Wed Mar 06, 2013 7:42 pm
Location: Eureka, California

Re: How do I test for in-equality, "A$ <> B$" & "A <> B"...?

Postby Daniel » Thu Jul 25, 2013 4:18 pm

Hi

Point taken. I will update the manual to reflect the fact that there are six relational operators.

Daniel
Daniel
 
Posts: 91
Joined: Tue Nov 13, 2012 2:10 pm

Re: How do I test for in-equality, "A$ <> B$" & "A <> B"...?

Postby Andries Pretorius » Thu Jul 25, 2013 11:51 pm

Apologies Robert! I did not fully understand your question the first time. I assumed that you new how to use the <> operator in Control Basic.

Thanks for pointing out the omission in the manual.

Best regards

Andries
Andries Pretorius
 
Posts: 37
Joined: Thu Nov 01, 2012 10:57 am
Location: Johannesburg, South Africa


Return to EzSBC1

Who is online

Users browsing this forum: No registered users and 1 guest

cron