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.
@L8129
:nON...GOSUB Statement Programming Example
  QuickSCREEN      Details     Example      Contents      Index
──────────────────────────────────────────────────────────────────────────────
ON...GOSUB Statement Programming Example
 
The following program fragment causes program control to branch to
one of the four subroutines listed, depending on the value of Chval:
 
DO
    CLS
    PRINT "1) Display attendance at workshops."
    PRINT "2) Calculate total registration fees paid."
    PRINT "3) Print mailing list."
    PRINT "4) End program."
    PRINT : PRINT "What is your choice?"
    DO
       Ch$=INKEY$
    LOOP WHILE Ch$=""
    Chval = VAL(Ch$)
    IF Chval > 0 AND Chval < 5 THEN
        ON Chval GOSUB Shop, Fees, Mailer, Progend
    END IF
LOOP
END