13.07.2015 Views

Turbo Basic

Turbo Basic

Turbo Basic

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAIN statementFunctionSyntaxRemarksCHAIN invokes a <strong>Turbo</strong> <strong>Basic</strong> chain module (created as a .TBC or.EXE file).CHAIN filespecfilespec is a string expression that follows standard DOS namingconventions and represents a <strong>Turbo</strong> <strong>Basic</strong> chain module (extension.TBC). If the extension is omitted, .TBC is assumed. Therefore, ifyou want to specify an .EXE file, you must append .EXE to the filename. The variables listed as COMMON in both the current programand the destination program are passed to the destinationprogram.In the testing phase, the calling program must be compiled to an.EXE file, because you can't chain from within <strong>Turbo</strong> <strong>Basic</strong>. Thecalled program must be compiled to disk as a chain module (an.EXE or .TBC file).If the arguments to the COMMON statements in the calling programand the called program don't match (for example, floatingpointvariables in one place and integers in another), a run-timeerror occurs.<strong>Turbo</strong> <strong>Basic</strong> doesn't support Interpretive BASIC's line numberorientedCHAIN options, including DELETE, MERGE, andCHAIN linenumber. Since you can't specify a line number within adestination chain module, execution always starts at the beginning.RestrictionsDifferencesSee AlsoIn translating a CHAINed system of Interpretive BASIC programsto <strong>Turbo</strong> <strong>Basic</strong>, you may find that <strong>Turbo</strong> <strong>Basic</strong>'s expanded useof memory allows consolidating individual modules into a singleprogram, making chaining unnecessary.CHAINing can only be done when a program is being executedfrom DOS; that is, from an .EXE file. MERGE, DELETE, ALL,and CHAINing to a line number are not supported.In <strong>Turbo</strong> <strong>Basic</strong>, CHAINing is done from one compiled program toanother that has been compiled to a .TBC or .EXE file.COMMON<strong>Turbo</strong> <strong>Basic</strong> Reference Directory 145

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!