Archive for the 'tomcat' Category

CHAPTER 6 MAKING DECISIONS WITH CONDITIONAL LOGIC (Web hosting rating)

Wednesday, May 7th, 2008

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.

172 CHAPTER 6 MAKING DECISIONS WITH CONDITIONAL (Web server)

Tuesday, May 6th, 2008

172 CHAPTER 6 MAKING DECISIONS WITH CONDITIONAL LOGIC Table 6-1. Continued Constant Classification Description TargetLittleEndian OS Returns a value of True if the application being run uses the Little Endian byte order (e.g., PCs). TargetCarbon OS Returns a value of True if the application being run executes Carbon/Mac OS X code (e.g., Mac Classic and Mac OS X). TargetMachO OS Returns a value of True if the application is being run on a Macintosh computer running Mac OS X. TargetMacOS OS Returns a value of True if the application is being run on a Macintosh computer running either Mac Classic or Mac OS X. TargetMacOSClassic OS Returns a value of True if the application is being run on a Macintosh computer running Mac Classic. TargetLinux OS Returns a value of True if the application is being run on a Linux computer. TargetWin32 OS Returns a value of True if the application is being run on a Windows computer. To understand the #If #EndIf statement, seeing it in action can help. The following statements demonstrate how to test for the OS being used to run the application. #If TargetMachO MsgBox(”This application is running on a computer running on Mac OS X.”) #ElseIf TargetWin32 MsgBox(”This application is running on a computer running on Windows.”) #ElseIf TargetLinux MsgBox(”This application is running on a computer running on Linux.”) #EndIf Note As the previous example demonstrates, the Then keyword is optional when working with the #If #EndIf statement. For another example of how to use the #If #EndIf code block, check out the RB Word Processor application in Chapter 9.
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check mysql web server services.

CHAPTER 6 MAKING DECISIONS WITH CONDITIONAL (Web design service) LOGIC

Monday, May 5th, 2008

CHAPTER 6 MAKING DECISIONS WITH CONDITIONAL LOGIC 171 You can also set up Case statements using different ranges or types of values, as the following shows. Select Case intMonthOfBirth Case 1, 4, 7, 10 MsgBox(”Department birthday celebrations occur on the 15th of the month.”) Return Case 2, 5, 8, 11 MsgBox(”Department birthday celebrations occur on the 21st of the month.”) Return Case 3, 6, 9, 12 MsgBox(”Department birthday celebrations occur on the 1st of the month.”) Return End Select #If #EndIf One of REALbasic s primary selling features is its capability to compile applications that can run on different OS platforms. Each OS platform has certain, completely unique features. For example, only Windows OSs support the registry. To develop applications that can execute on certain OSs, at times, you need to customize portions of your application to leverage OS-specific features. To provide you with a mechanism for handling these situations, REALbasic provides the #If #EndIf block. The #If #EndIf block can be used to handle other situations, too, such as supporting the creation of applications that require features found in certain versions of REALbasic or that run differently in debug mode versus as a standalone application. REALbasic limits the #If #EndIf block s functionality by only allowing it to work with a specific set of Boolean constants, which Table 6-1 shows. Table 6-1. REALbasic Boolean Constants Constant Classification Description DebugBuild Debug vs. Standalone Evaluates to True when the application is run within the REALbasic IDE. RBVersion REALbasic Version Returns a True or False value, indicating the version level being used to run a REALbasic application. TargetHasGUI Application Type Returns a value of True if the application being run is a Desktop application (as opposed to a Console, Service, or Event Driven Console application). TargetBigEndian OS Returns a value of True if the application being run uses the Big Endian byte order (e.g., Macintosh systems). Continued
Please visit Domain Name Hosting services for high quality webhost to host and run your jsp applications.

Sri lanka web server - 170 CHAPTER 6 MAKING DECISIONS WITH CONDITIONAL

Monday, May 5th, 2008

170 CHAPTER 6 MAKING DECISIONS WITH CONDITIONAL LOGIC Note Select Case statements can include an optional Case Else statement that executes only when none of the defined Case statements match up against the tested value. Note, the Select Case block accepts either Case Else or Else as the format of the optional Else clause. As you can see, a Select Case block is easier to read when compared to nested If Then blocks. In addition, Select Case blocks typically require less code statements to set up. The following example demonstrates how to set up a typical Select Case block. Select Case strCustomerName Case “Walmart” MsgBox(”Customer account number is 6765765765765.”) Return Case “Target” MsgBox(”Customer account number is 6769382576767.”) Return Case “Roses” MsgBox(”Customer account number is 1231435 456755.”) Return Case “Sears” MsgBox(”Customer account number is 98978562546573.”) Return Case Else MsgBox(”An account must be set up for this new customer.”) End Select In this example, a message is displayed depending on whether the value assigned to the strCustomerName variables match any of the values specified in the Case statements. However, if no match is found, the Case Else statement executes. Case statements are flexible. For example, you can set them up to check for a range of values using the To keyword, as the following shows. Select Case intNoOfPoints Case 1 To 1000 MsgBox(”Continue your training my young padewan learner.”) Return Case 1001 To 10000 MsgBox(”Your Jedi skills are indeed most impressive!”) Return Case 10001 To 1000000 MsgBox(”Congratulations Master Jedi, you are truly strong with the force.”) Return End Select
We would like to recommend you tested and proved virtual web hosting services, which you will surely find to be of great quality.

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

Sunday, May 4th, 2008

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.

168 CHAPTER 6 (Submit web site) MAKING DECISIONS WITH CONDITIONAL

Saturday, May 3rd, 2008

168 CHAPTER 6 MAKING DECISIONS WITH CONDITIONAL LOGIC The problem with the previous example is this: if the user selected the first RadioButton control, REALbasic is still required to process the second If Then block, even though it is not selected. Rather than creating multiple If Then blocks, as was done in the previous example, you can set things up to be more efficient using the Else statement to set up an If Then Else block as the following shows. If rbnYellow.Value = True Then Window1.BackColor = &cFFFF80 Else Window1.BackColor = &cC0C0C0 End If As you can see, this example is one line shorter than the previous example, yet it performs exactly the same thing, while simplifying the code so REALbasic only has to perform one conditional test. The If Then ElseIf Blocks REALbasic also provides you with the capability to set up If Then ElseIf blocks, which test for any number of possible conditions and execute the code statements associated with the first matching condition. For example, you could add an additional RadioButton control to the previous example, and then modify the code statements assigned to the PushButton control, as the following shows. If rbnYellow.Value = True Then Window1.BackColor = &cFFFF80 ElseIf rbnGrey.Value = True Then Window1.BackColor = &cC0C0C0 ElseIf rbnWhite.Value = True Then Window1.BackColor = &cFFFFFF End If In this example, three separate conditions are tested and, whichever one proves True, is executed, while the others are skipped. Nesting If Then Blocks REALbasic also enables you to embed, or nest, If Then blocks within one another. In doing so, you can create complex conditional tests that begin by testing for one condition, and then perform further testing when required, as the following example shows. If blnGameOver = True Then If intNoOfPoints <= 1000 Then MsgBox("Continue your training my young padewan learner.") End If
Go visit our java server pages services for a reliable, lowcost webhost to satisfy all your needs.

CHAPTER 6 MAKING DECISIONS WITH (Web site builder) CONDITIONAL LOGIC

Friday, May 2nd, 2008

CHAPTER 6 MAKING DECISIONS WITH CONDITIONAL LOGIC 167 Note A RadioButton control is used to present users with a choice between two options. By default, all RadioButton controls on a window function as a group, meaning only one RadioButton can be selected at a time. By grouping RadioButton controls together, using the GroupBox control as an example, you can create separate groupings of RadioButton controls, each of which is independent of other groups. You can use the Properties window to specify a default RadioButton selection by enabling the Value property for one of the RadioButton controls in a grouping. Programmatically, you can change the currently selected RadioButton by setting its Value property to True. Similarly, you can check to see if a RadioButton control s Value property has been set, as the previous example shows. As you can see, two If Then blocks are set up. The first If Then block checks to see if the Value property belonging to the first RadioButton control is set to True (for example, that it has been selected). If it was selected, then the next statement executes and sets the BackColor property of the window to Yellow. The second If Then block performs a second test, this time looking to see if the value of the second RadioButton control was selected. Figure 6-2 demonstrates how the selection of the RadioButton labeled Yellow changes the window s background color. Figure 6-2. Using If Then blocks to process the value of RadioButton controls
You need excellent and relaible webhost company to host your web applications? Then pay a visit to Inexpensive Web Hosting services.

Web server on xp - 166 CHAPTER 6 MAKING DECISIONS WITH CONDITIONAL

Thursday, May 1st, 2008

166 CHAPTER 6 MAKING DECISIONS WITH CONDITIONAL LOGIC The If Then Else Block You can expand the If Then block to include an optional Else statement. When you do so, you provide an alternative course of action that should be taken if the tested condition turns out to be False instead of True. For example, suppose you create the application you see in Figure 6-1. Figure 6-1. Using conditional logic to modify a window s background color In this example, a GroupBox control has been added to the application s window and populated with two RadioButton controls, each of which is associated with a different color. A PushButton has also been added to the GroupBox control. By adding the following code statements to the PushButton control, you provide the user with the capability to change the window s background color. If rbnYellow.Value = True Then Window1.HasbackColor = True Window1.BackColor = &cFFFF80 End If If rbnGrey.Value = True Then Window1.HasbackColor = True Window1.BackColor = &cC0C0C0 End If
From our experience, we are can tell you that you can find a reliable and cheap webhost service at Java Web Hosting services.

Free php web host - CHAPTER 6 MAKING DECISIONS WITH CONDITIONAL LOGIC

Wednesday, April 30th, 2008

CHAPTER 6 MAKING DECISIONS WITH CONDITIONAL LOGIC 165 Single Line If Then Statements In many cases, all you need to set up a conditional test is a single line If Then statement. For example, each of the following statements is a single line If Then statement. If strUserName = “Molly” Then MsgBox(”Hello Molly”) If strUserName = “Molly” MsgBox(”Hello Molly”) If strUserName = “Molly” Then MsgBox(”Hello Molly”) Else MsgBox(”Hello”) In the first example, the value of strUserName is tested to see if it is equal to Molly and if it is (for example, if the test result evaluates to True), the MsgBox function that follows the Then keyword is executed. However, if the result of the text is False, the MsgBox function is not processed. The second statement shown in the previous code is almost identical to the first statement, except the Then keyword is omitted. The Then keyword is optional on single line If Then statements. The third example shown in the previous code demonstrates how to provide an alternate course of action in case the test result is False. In this example, if strUserName equals Molly , then MsgBox( Hello Molly ) is executed and the rest of the statement is skipped. However, if strUserName does not equal Molly , then the first instance of the MsgBox function is skipped and the second instance is executed (for example, MsgBox( Hello ). Note When using the single line form of the If Then statement, the closing End If statement, which normally follows an If Then statement, is omitted. Multiple Line If…Then Blocks In most cases, you won t be able to fit everything on one line that you want to achieve with an If Then statement. In these cases, you can set up an If…Then code block, as the following shows. If blnExitApp = True Then MsgBox(”You have elected to close the application.”) Quit End If As this example shows, you can embed more than one statement inside an If Then block. In this example, if the value assigned to the blnExitApp variables is equal to True, then all of the statements in between the opening If Then statement and the closing End If statement are executed. However, if the value assigned to blnExitApp is equal to False, then the code statements inside the If Then block are skipped and program execution continues with the next programming statement following the If Then block. Tip Good programming practice is to use code blocks in place of single line If Then statements. This way, if you have to come back later and insert additional code statements, the necessary structure will already be in place.
In case you need quality webspace to host and run your web applications, try our personal web hosting services.

164 CHAPTER 6 MAKING DECISIONS WITH CONDITIONAL (Web site)

Tuesday, April 29th, 2008

164 CHAPTER 6 MAKING DECISIONS WITH CONDITIONAL LOGIC can use to implement conditional logic, each of which is designed to handle different situations. These statements include the following: If Then. Tests a specific condition and conditionally executions code statements based on the results of the test. Select Case. Tests different conditions against a specific value, and then executes code statements for the first matching condition. #If #EndIf. Conditionally executes code statements based on the operating system (OS) on which the application is executing. Working with the If Then Statement The If Then statement provides you with the capability to test a single condition, and then evaluate the results to conditionally execute code statements based on the results of the test. The If Then statement is so important, it is almost impossible to develop an application of any complexity without it. The following outlines the syntax of the If Then statement. If Condition Then statements ElseIf condition Then statements Else statements End If Condition is a placeholder that represents a condition that evaluates to either True of False. Statements are placeholders representing executed code statements based on the results of the tests. The If Then statement is extremely flexible and supports numerous variations, including the following: Single line If Then statements Multiple line If Then blocks The If Then Else Blocks The If Then ElseIf blocks Note If Then, Select Case, and #If #EndIf statements, and any programming statement you embed within them, are sometimes referred to as code blocks.
You want to have a cheap webhost for your apache application, then check apache web hosting services.