CHAPTER 5 STORING (Web hosting domain names) AND RETRIEVING APPLICATION DATA

CHAPTER 5 STORING AND RETRIEVING APPLICATION DATA If InStr(OutputField.Text, ” - “) > 0 Then dblResult = Val(OutputField.Text.Left(Instr(OutputField.Text, _ ” - “))) Val(OutputField.Text.Mid(Instr(OutputField.Text, _ ” - “) + 2)) End If If InStr(OutputField.Text, ” * “) > 0 Then dblResult = Val(OutputField.Text.Left(Instr(OutputField.Text, _ ” * “))) * Val(OutputField.Text.Mid(Instr(OutputField.Text, _ ” * “) + 2)) End If If InStr(OutputField.Text, ” / “) > 0 Then dblResult = Val(OutputField.Text.Left(Instr(OutputField.Text, _ ” / “))) / Val(OutputField.Text.Mid(Instr(OutputField.Text, _ ” / “) + 2)) End If OutputField.Text = Str(dblResult) Button1.Enabled = False Button2.Enabled = False Button3.Enabled = False Button4.Enabled = False Button5.Enabled = False Button6.Enabled = False Button7.Enabled = False Button8.Enabled = False Button9.Enabled = False Button0.Enabled = False DecimalButton.Enabled = False NegativeButton.Enabled = False The first statement declares a variable named intResult with a data type of Double to ensure the calculator can handle nearly any number the user might enter. The next four sets of statements are If Then blocks, each of which is designed to handle a particular operation. The first If Then block is set up to look for the presence of a + character in the equation entered by the user. If present, then the following statement is executed. dblResult = Val(OutputField.Text.Left(Instr(OutputField.Text, ” + “))) + Val(OutputField.Text.Mid(Instr(OutputField.Text, “+”) + 2))
If you are searching for cheap webhost for your web application, please visit MySQL5 Web Hosting services.

Leave a Reply