qb45advr.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
END Statement Programming Example
  QuickSCREEN      Details     Example      Contents      Index
──────────────────────────────────────────────────────────────────────────────
END Statement Programming Example
 
These examples show how to use END IF and END SELECT forms of the
END statement to terminate IF...THEN...ELSE and SELECT CASE blocks.
 
Here is an example of using END IF with a block IF...THEN...ELSE
for a multiple-choice decision:
 
  INPUT X
  IF X = 1 THEN
    PRINT "one"
  ELSEIF X = 2 THEN
    PRINT "two"
  ELSEIF X = 3 THEN
    PRINT "three"
  ELSE
    PRINT "must be integer from 1-3"
  END IF
 
This example uses the SELECT CASE structure to do the same thing:
 
  INPUT X
  SELECT CASE X
    CASE 1
      PRINT "one"
    CASE 2
      PRINT "two"
    CASE 3
      PRINT "three"
    CASE ELSE
      PRINT "must be integer from 1-3"
  END SELECT