Page

5.4.0- Branching Statements

Created by Brendan Doss.
Last Updated by Brendan Doss.  

PublicCategorized as 05. ASP Control Structures.

Not yet tagged
<< 5.3.4- Examples of Control StructuresChapter55.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 StructuresChapter55.4.1- If...Then Control Structure >>

Copyright © 2003 by Wiley Publishing, Inc.

Powered by Near-TimeTerms of Services | Privacy Policy | Security Policy |