Friday, March 13, 2009

Week 5

This week we moved on to Chapter 5 and looked at IF statements, ELSE Statements and ELSEIF statements. These allow the program to only run a certain piece of code depending on what the user does. We also used a few new tools, group boxes and radio buttons.
We had to create a program that compared two strings to see if they were equal (=), less than (<) or greater than (>) each other. The result was then displayed in a Message Box. To avoid the program crashing if the user doesn’t enter something into both text boxes we used an if statement at the start of the code, If txtString1.Text <> "" And txtString2.Text <> "" Then, if there wasn’t anything entered we had to display a Message Box with an error message warning the user to enter something into both text boxes.

No comments:

Post a Comment