Question about Comparisons and Operator Symbols - Learn TO Code

Started by kevin, October 09, 2022, 07:19:22 PM

Previous topic - Next topic

kevin


This question came in recently..  So here's a quick response on the subject.  You can find more on the PlayBASIC Help files (online link bellow)

What are ">=, >, <, <=, == , !="   all these and why would they need to get used?"

Most of those are comparison operators.  So we use them to compare the terms on either side of the operator.   

>= compare if the LEFT term is Bigger than or equal to the RIGHT term

<=  compare if the LEFT term is Less than or equal to the RIGHT term

> compare if the LEFT term is Bigger than  the RIGHT term

< compare if the LEFT term is Less  than  the RIGHT term

==  compare if the LEFT term is equal to the RIGHT term

!= compare if the LEFT term is NOT EQUAL to  the RIGHT term

So in regards to why we would use them; well whenever we need to check if two terms are numerically the same (Equal too) or similar or even not equal we can use the appropriate operator to do the comparison for us which will then return a boolean result of TRUE(1) or FALSE(0)..  back to us.


Read more about Comparisons and Operators in our Help Files

COMPARISONS TUTORIAL
OPERATORS TUTORIAL