Say, Bill, were you the one a few days ago that was trying
to print a printer file from within QB and couldn't get
it to work? You tried opening it for binary and printing
it to the printer as well as using SHELL, but nothing
worked? At the time, I didn't think of it, but it just now
popped into my mind that there is an interrupt that you
can call to execute a given command line; did you try that
method? It's been a long time since I worked with this code,
but you're welcome to give it a try. Wish now I'd written
some comments! It's written as a function, I believe, because
it returns some sort of error code or result code.
FUNCTION RCShell% (ProgName$, Params$)
'ProgName$ must include the full path and file name
' of the program to be executed
DIM Regs AS RegTypeX
ProgName$ = ProgName$ + CHR$(0)
Params$ = CHR$(LEN(Params$)) + Params$ + CHR$(13)
PBlock$ = CHR$(0) + CHR$(0) + " "
SegAddr% = VARSEG(Params$)
StrAddr% = SADD(Params$)
DEF SEG = VARSEG(PBlock$)
PBlockAddr% = SADD(PBlock$)
POKE PBlockAddr% + 2, StrAddr% AND 255 'Qb
POKE PBlockAddr% + 3, StrAddr% \ 256 'Qb
POKE PBlockAddr% + 4, SegAddr% AND 255 'Qb
POKE PBlockAddr% + 5, SegAddr% \ 256 'Qb
DEF SEG
'execute the program
Regs.AX = &H4B00
Regs.BX = SADD(PBlock$)
Regs.DX = SADD(ProgName$)
Regs.DS = -1
Regs.ES = VARSEG(PBlock$)
INTERRUPTX &H21, Regs, Regs
'get the return code
Regs.AX = &H4D00
INTERRUPTX &H21, Regs, Regs
RCShell% = Regs.AX
END FUNCTION
---
þ SLMR 2.1a þ Objectivity is in the eye of the beholder.
--- FLAME v1.1
---------------
* Origin: TC-AMS TBBS 2.3 [64] - Minnetonka MN - (612)-938-4799 (1:282/7)
|