| << 5.3.4- Examples of Control Structures | Chapter5 | 5.4.1- If...Then Control Structure >> |
Branching Statements
ASP offers two techniques for branching. If...Then is used when there are only a few choices of outcome. Bear in mind that the more lines you use in If...Then, the more difficult your code can become to follow. Select...Case is used when there are a lot of outcomes.
For example, if you are asking the user "Do you want a confirmation by telephone?" the outcome is either Yes (True) or No (False), so you would perform the branch using If...Then. But if you ask the user "Do you want confirmation by telephone or Fax or FedEx or E-mail or Voicemail or Telepathy?" given the amount of outcomes, then it is probably better to use Select...Case. We will start with If...Then.
| << 5.3.4- Examples of Control Structures | Chapter5 | 5.4.1- If...Then Control Structure >> |

RSS
