User Tools

Site Tools


chain_execute_another_program_.htm
Navigation:  Language Reference > 13 - Built-in Functions >====== CHAIN (execute another program) ====== Previous pageReturn to chapter overviewNext page

 

CHAIN(program)

blk2blue.jpg

CHAIN Terminates the current program and executes another.
program A string constant or variable containing the name of the program and optional command line parameters to execute. This may be any .EXE or .COM program.

CHAIN terminates the current program, closing all files and returning its memory to the operating system, and executes another program.

Example:

PROGRAM                          !MainMenu program code

CODE

EXECUTE CHOICE()

CHAIN('Ledger')                 !Execute LEDGER.EXE

CHAIN('Payroll /Test=1 /N=2')   !Execute PAYROLL.EXE with parameters

 RETURN                          !Return to O/S

END

 PROGRAM                         !Ledger program code

CODE

EXECUTE CHOICE()

CHAIN('MainMenu')               !Return to MainMenu program

 RETURN                          !Return to O/S

END

PROGRAM                          !Payroll program code

CODE

EXECUTE CHOICE()

CHAIN('MainMenu')               !Return to MainMenu program

 RETURN                          !Return to O/S

END

See Also:

RUN

chain_execute_another_program_.htm.txt · Last modified: 2021/04/15 15:57 (external edit)