CHAPTER 6 MAKING DECISIONS WITH CONDITIONAL LOGIC (Dedicated web hosting)

CHAPTER 6 MAKING DECISIONS WITH CONDITIONAL LOGIC 169 If intNoOfPoints >= 1001 Then If intNoOfPoints <= 10000 Then MsgBox("Your Jedi skills are indeed most impressive!") End If End If If intNoOfPoints >= 10001 Then MsgBox(”Congratulations Master Jedi, you are truly strong with the force.”) End If End If In this example, the value of blnGameOver is tested to see if it is equal to True (for example, if it is time to end the game). If it is time, a number of nested If Then blocks are executed to determine the player s score. Tip You can create extremely complex testing logic by embedding If Then statements and blocks. However, remember, nesting too deeply can make your program code difficult to maintain and understand. As an alternative to embedding If Then statements, you can use logical operators to combine comparison operations. Logical operators are covered in the section Logical Operators. The Select Case Block At times, you might want to test a single condition against a number of possible values. While you can certainly perform this type of test using an If…Then ElseIf block, REALbasic also provides you with the Select Case block, which is better suited to performing this type of test. While an If Then ElseIf block evaluates each ElseIf statement, a Select Case block stops executing once a matching Case statement is found, making it more efficient. The following outlines the syntax for the Select Case block. Select Case expression Case value statements Case value statements Case Else statements End Select The Select Case block begins with the Select Case statement and ends with the End Select statement. Individual Case statements are defined inside the Select Case block that identifies possible matching values. When a match occurs, the code statements in between the matching Case statement and the next Case statement are executed.
From our experience, we are can tell you that you can find a reliable and cheap webhost service at Java Web Hosting services.

Leave a Reply