Category : BASIC Source Code
Archive   : LINKBAS.ZIP
Filename : SETCMD.DOC

 
Output of file : SETCMD.DOC contained in archive : LINKBAS.ZIP

Title: "Fancy Passing"
Reference: PC World September 1990
Author: Bob Manookian
Files: SETCMD.DOC, SETCMD.ASM, SETCMD.OBJ,
PROG1.BAS, PROG2.BAS

When QuickBASIC programs become too large for a single code file, a
solution is to divide the code among separate modules. This often
means you'll need to pass data between the individual programs that
made up your application. But if you use the BASIC compiler's /o option
to generate stand-alone EXE files, you can't use COMMON variables for
this purpose.

An assembly language routine, SETCMD.ASM saves the day. CALLing
SetCmd before a RUN statement copies a string argument into the tail
end of the command line, passing the string to another program. That
data might contain variables, ASCII text, or the name of a data file
for the called program to read. SETCMD.OBJ is ready to use, but if you
have the Microsoft Macro Assembler 5.1, you can assemble SETCMD.ASM
using the command masm setcmd;.

PROG1.BAS and PROG2.BAS demonstrate how to use SETCMD. With the
QuickBASIC compiler and linker on the current path, enter the
commands bc /o prog1; and link prog1+setcmd;. Then type bc /o prog2;
and link prog2;. Run the test program by entering prog1 arg1. After
PROG1 displays `Prog1:Arg1', it calls PROG2, which displays the
argument passed to SetCmd.>


  3 Responses to “Category : BASIC Source Code
Archive   : LINKBAS.ZIP
Filename : SETCMD.DOC

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/