Saturday, September 18, 2010

Infobasic Begin Case End Case

Use the CASE statement to alter the sequence of instruction execution based on the value of one or more expressions. If expression in the first CASE statement is true, the following statements up to the next CASE statement are executed. Execution continues with the statement following the END CASE statement. If the expression in a CASE statement is false, execution continues by testing the expression in the next CASE statement. If it is true, the statements following the CASE statement up to the next CASE or END CASE statement are executed. Execution continues with the statement following the END CASE statement. If more than one CASE statement contains a true expression, only the statements following the first such CASE statement are executed. If no CASE statements are true, none of the statements between the BEGIN CASE and END CASE statements are executed.

Example

USERNAME = @LOGNAME
BEGIN CASE
     CASE USERNAME = "TOM"
          DEPARTMENT = "HR"
      CASE USERNAME = "DICK"
           DEPARTMENT = "ADMIN"
      CASE 1 (or OTHERWISE) ;* DEFAULT CASE     
"DEPARTMENT NOT FOUND" 
 END CASE

1 comments:

Anonymous said...

Nice Article. Thanks for sharing usefull Information and I have seen more info onTop Hotel Management College with Affiliated to Osmania University

Post a Comment

 

Blog Info

A Pakistani Website by Originative Systems

Total Pageviews

Tutorial Jinni Copyright © 2015 WoodMag is Modified by Originative Systems