CHAPTER 6 MAKING DECISIONS WITH CONDITIONAL LOGIC (Web hosting rating)
CHAPTER 6 MAKING DECISIONS WITH CONDITIONAL LOGIC 173 REALbasic Operators As you have already seen in this book, REALbasic uses comparison operators in the formulation of program statements that involve conditional logic. REALbasic also uses mathematical operators when working with numbers. In addition to comparison and mathematical operators, REALbasic also supports the use of logical operators that facilitate the testing of more than one condition at a time. Comparison Operators For REALbasic to make any type of comparison, it must be told what type of comparison to make. In most of the examples you have seen up to this point, comparisons were made based on equality. In other words, the equals (=) operator was used to ask REALbasic to determine if two values were equal. In addition to checking for equality, REALbasic provides you with a collection of other comparison operators that give you with the capability to check for a range of values. Table 6-2 provides a complete list of REALbasic s comparison operators. Table 6-2. REALbasic Comparison Operators Operator Type Example = Equals If X = 18 Then <> Not Equals If X <> 18 > Greater Than If X > 18 < Less Than If X < 18 >= Greater Than or Equal To If X >= 21 <= Less Than or Equal To If X <= 21 You have the chance to work with a number of these operators when you create the RB Number Guess game in the section Creating a Computer Game. Note In addition to using REALbasic s comparison operators for the obvious task of comparing numeric data, you can also use them when you work with string values. String comparisons are case-insensitive, meaning Bob and bob are equal to one another. However, Ann is considered less than Bob because, alphabetically, Ann comes before Bob.
We would like to recommend you tested and proved virtual web hosting services, which you will surely find to be of great quality.