IB Statements/run

From CometWiki

< IB Statements(Difference between revisions)
Jump to: navigation, search
(New page: '''RUN statement''' '''Syntax:''' RUN program [,DIR=directory] [,EXCP=statement-label] '''Discussion:''' The RUN statement terminates the current program and calls in another progra...)
 
Line 1: Line 1:
'''RUN statement'''  
'''RUN statement'''  
-
'''Syntax:'''  RUN program [,DIR=directory] [,EXCP=statement-label]   
+
'''Syntax:'''  RUN program [,DIR=directory] [,EXCP=statement-label | NOEXCP]   
'''Discussion:'''  The RUN statement terminates the current program and calls in another program to be loaded and executed in the same partition. Because it causes an exit from the current program and transfers control to the called program, RUN is the last statement to be executed.  
'''Discussion:'''  The RUN statement terminates the current program and calls in another program to be loaded and executed in the same partition. Because it causes an exit from the current program and transfers control to the called program, RUN is the last statement to be executed.  

Latest revision as of 22:23, 28 May 2009

RUN statement

Syntax: RUN program [,DIR=directory] [,EXCP=statement-label | NOEXCP]

Discussion: The RUN statement terminates the current program and calls in another program to be loaded and executed in the same partition. Because it causes an exit from the current program and transfers control to the called program, RUN is the last statement to be executed.

You cannot return to the original program automatically. It must be recalled by another RUN statement.

Also see ACTIVATE and ENTER.

Example 1: RUN "MAINMENU",DIR="DSK"

In this example, the RUN statement runs a program called MAINMENU, which is located on directory DSK.

Example 2: IF OPTION$="QUIT" THEN RUN "MAINMENU"

In this example, the variable named OPTION$ is tested. If OPTION$ is equal to "QUIT," the MAINMENU program is executed.

Personal tools