160 CHAPTER 5 STORING AND RETRIEVING APPLICATION (Web hosting bandwidth)
160 CHAPTER 5 STORING AND RETRIEVING APPLICATION DATA This statement uses a series of REALbasic functions to process the equation the user enters. Here is a step-by-step breakdown of what happens when this statement executes. 1. The Instr function is used to locate the position of the + character in the equation. 2. This information is then fed to the Left function, which uses it to extract all the characters from the beginning of the text string to the + character. 3. The Val function is used to convert the remaining value to a number. 4. The Instr function is again used to locate the position of the + character in the equation. 5. The Mid function is then used to extract the remainder of the text in the EditField, starting two character positions to the right of the + character. 6. The Val function is then used to convert the remaining value to a number. 7. Finally, the numeric value extracted from step 3 is added to the numeric value extracted in step 6 and assigned to the intResult variable. Note Refer to REALbasic s online reference (Help . Language Reference) for detailed explanations of the syntax for various REALbasic functions. The remaining If Then blocks are designed to perform a similar set of steps for the subtraction, multiplication, and division operations. The first statement following the last If Then block converts the value of intResult to a String and displays the results in the EditField control (named OutputField). The remaining statements disable all the PushButton controls on the application, except for the PushButtons representing the Equals, Off, and Clear operations. Now, add the following statement to the PushButton control representing the Off button. Quit As you can see, this statement simply terminates the application when this PushButton control is clicked. Finally, add the following statements to the PushButton control representing the Clear button. OutputField.Text = “” PlusButton.Enabled = True MinusButton.Enabled = True DivisionButton.Enabled = True MultiplicationButton.Enabled = True
You need excellent and relaible webhost company to host your web applications? Then pay a visit to Inexpensive Web Hosting services.