Chain Command In Quickbas

 BBS: Inland Empire Archive
Date: 11-18-92 (08:05)             Number: 342
From: ALLAN ZACHARY                Refer#: NONE
  To: CRUZ MONCIVAIS                Recvd: NO  
Subj: Chain Command In Quickbas      Conf: (2) Quik_Bas
CM> The only way I have found to share
CM> var. is to create a file that the called program will read t
CM> during the init. phase.  It is crude method but it works wit
CM> the run time lib and the called exe file will delet the file
CM> one reading.  And the calling exe creates file just prior t
CM> chain statement.

Hello Cruz! Here is a 16-byte buffer you can access for CHAINing
standalone EXE's. I know, it's not much, but its good for passing
a filename or a password etc.
                                              -Allan

P.S. Let me know if it works with anything other than MS-DOS!

'----------------- Program 1:   Clip Here! ---------------------
DEFINT A-Z
DECLARE SUB PutChainBuf (Svar$)
CLS
PutChainBuf "I'm still here!"
PRINT "IAC is stuffed! Now go run Windows or whatever..."
PRINT "Then run program 2 to see if IAC is still intact."
END

' Stores String in MS-DOS Intra-Application Communication area
'(16 Bytes of free CHAIN space for stand-alone EXE's courtesy of DOS.)
SUB PutChainBuf (Svar$) 'by Allan Zachary, Nov. 1992
    L = LEN(Svar$)
    IF L > 16 THEN  ' Max=16 Bytes
        Svar$ = LEFT$(Svar$, 16)
        L = 16
    END IF
    DEF SEG = &H40
    FOR i = 1 TO L
        Offset = &HF0 - 1 + i
        POKE Offset, ASC(MID$(Svar$, i, 1))
    NEXT i
    DEF SEG
END SUB
'---------------------------------------------------------------

'----------------- Program 2:   Clip Here! ---------------------
DEFINT A-Z
DECLARE FUNCTION GetChainBuf$ ()
CLS
PRINT "IAC buffer = "; GetChainBuf$
END

' Retrieves the MS-DOS Intra-Application Communication area
FUNCTION GetChainBuf$ 'by Allan Zachary, Nov. 1992
    DEF SEG = &H40
    FOR i = 1 TO 16
        Offset = &HF0 - 1 + i
        Svar$ = Svar$ + CHR$(PEEK(Offset))
    NEXT i
    DEF SEG
    GetChainBuf$ = Svar$
END FUNCTION
'---------------------------------------------------------------

 * SLMR 2.1a *


--- WM v2.04/91-0010
 * Origin: FliegWeg BBS - Home of VitaCal - (210) 496-6550 (1:387/403)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET