bas7ex.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.
GOTO Statement Programming Example
                       Example                 Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
'This example calculates the area of a circle after you supply the
'radius. It uses the GOTO statement to repeat the procedure.
 
CLS         'Clear screen.
PRINT "Input 0 to end."
Start:
   INPUT "Radius";R
   IF R = 0 THEN
      END
   ELSE
      A = 3.14 * R ^ 2
      PRINT "Area ="; A
   END IF
GOTO Start
 
'Sample Output
'
'Input 0 to end.
'Radius? 5
'Area = 78.5
'Radius? 0