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.
CHAIN Statement Details
◄Summary► ◄Details► ◄Example► ◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
CHAIN filespec$
Usage Notes
■ Programs running in the programming environment assume a .BAS extension
if no extension is given and cannot chain to executable files (files
with a .COM or .EXE extension).
■ Programs running outside the programming environment assume an .EXE
extension and cannot chain to Basic (.BAS) source files.
■ You can pass variables between programs using the COMMON Statement to
set up a blank COMMON block. See: ◄COMMON Statement►
■ When you compile a program outside the Visual Basic environment, the
VBDRT10.LIB library does not support COMMON. To use COMMON with chained
programs outside the environment, you must either:
• Select the EXE Requiring Run-Time Module option from the Make EXE File
dialog when you compile. This is the default option (uses the file
VBDRT10.EXE).
• Compile from the command line (BC.EXE) without the /O option.
■ When programs use VBDRT10.EXE, files are left open during chaining
unless they are explicitly closed with the CLOSE statement.
See: ◄CLOSE Statement►
■ CHAIN is similar to RUN; the main differences are that RUN closes all
open files and does not support data blocks declared with COMMON.
See: ◄RUN Statement►
■ CHAIN is equivalent to RUN when the /O compiler option is used.
■ If you compile a program (without /O) that does not use ISAM and then
attempt to CHAIN to another non-/O program that does use ISAM, Visual
Basic generates the error message, "Error loading run-time module
(VBDRT10.EXE) - ISAM support removed." Likewise, if you compile a
program (without /O) that does not use forms and then attempt to CHAIN
to another non-/O program that does use forms, Visual Basic generates
the error message, "Error loading run-time module (VBDRT10.EXE) - form
support removed."