Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 
Table of contents Previous: McBASI Interpreter Commands CLOSE Next: McBASI Interpreter Commands GOTO

GOSUB

Changes the normal downward flow of control.


Syntax

GOSUB x


Parameter

x

any valid numeric expression


Remark

This command is like GOTO, except control may be returned to the statement following the GOSUB by executing a RETURN statement.


Example

GOSUB 1000  
  100 REM Return Here
  .  
  .  
  1000 PRINT B
  1010 RETURN

In this example, control is returned to line 100.


Table of contents Previous: McBASI Interpreter Commands CLOSE Next: McBASI Interpreter Commands GOTO
 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Office of Programs University Corporation for Atmospheric Research (UCAR)   Unidata is a member of the UCAR Office of Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690