QB4.5 External Program Launch Problem 
Author Message
 QB4.5 External Program Launch Problem

Hiya,

So I was writing a file manager/app launch program in qb4.5, and suddenly
I had a problem. If I use shell to launch external apps, then according
to the help files, QB stays resident in memory. I'm doing this for an old
laptop I resucitated and it doesn't have the memory to spare. How else
can I launch those external programs?

Thanks,
Paul



Sun, 06 May 2001 03:00:00 GMT  
 QB4.5 External Program Launch Problem
Use the undocumented COMMAND.COM function at INT 2Fh, subfunction AE01h
"EXECUTE".  This function executes the given command line (such as a
program) and returns control to DOS when that command has completed.  The
program that calls this function is unloaded from memory before the new
program is executed.
--
When replying to this message, remove all occurrences of the word "dot"
from my e-mail address.



Quote:
> So I was writing a file manager/app launch program in qb4.5, and suddenly
> I had a problem. If I use shell to launch external apps, then according
> to the help files, QB stays resident in memory. I'm doing this for an old
> laptop I resucitated and it doesn't have the memory to spare. How else
> can I launch those external programs?



Sun, 06 May 2001 03:00:00 GMT  
 QB4.5 External Program Launch Problem

Quote:

>So I was writing a file manager/app launch program in qb4.5, and suddenly
>I had a problem. If I use shell to launch external apps, then according
>to the help files, QB stays resident in memory. I'm doing this for an old
>laptop I resucitated and it doesn't have the memory to spare. How else
>can I launch those external programs?

There is a method which works, though it may sound a bit kludgy.  Create
a BAT file, and execute the QB4.5 program from it.  If the QB4.5 program
needs to run another program, then it can create a temporary file.  When
the QB4.5 program exits, the BAT file can check for the existence of the
temporary file.  If it exists, then the BAT file deletes the temporary
file and runs the second program.

Another more flexible possibility is that the QB4.5 program create another
BAT file, and the original BAT file can test for its existence, and CALL
it if it exists.  This way the QB4.5 program can easily cause any other
program of any name to be executed on the fly, or even do other commands

this can happen with a clean screen display.
--

Sun Valley Systems    http://personal.bhm.bellsouth.net/~judmc
"For God so loved the world that He gave His only begotten Son, that
whoever believes in Him should not perish but have everlasting life."



Mon, 07 May 2001 03:00:00 GMT  
 QB4.5 External Program Launch Problem

: There is a method which works, though it may sound a bit kludgy.  Create
: a BAT file, and execute the QB4.5 program from it.  If the QB4.5 program
: needs to run another program, then it can create a temporary file.  When
: the QB4.5 program exits, the BAT file can check for the existence of the
: temporary file.  If it exists, then the BAT file deletes the temporary
: file and runs the second program.

: Another more flexible possibility is that the QB4.5 program create another
: BAT file, and the original BAT file can test for its existence, and CALL
: it if it exists.  This way the QB4.5 program can easily cause any other
: program of any name to be executed on the fly, or even do other commands

: this can happen with a clean screen display.

Thanks, Judson. Kludgey=good. Very clever solution. :)

Paul



Mon, 07 May 2001 03:00:00 GMT  
 QB4.5 External Program Launch Problem
Here's a take off on Judson's method:
Make sure you load QB with the /L switch

test.exe
REM If errorlevel is 2 or greater the message will display
if errorlevel 2 ECHO Running Test.bat

Make the file test.exe from the basic program below:

'pass an error level to dos and exit
'Include the following declaration in your program:
DECLARE SUB ErrorExit ALIAS "_exit" (BYVAL Errorlevel%)
PRINT "Running test.exe"
Errorlevel% = 2
CALL ErrorExit(BYVAL Errorlevel%)

If you run this program from the environment it will simply kick you out of
QB back to the dos prompt.  To work, it has to be run from the exe.

ChasG

--
---
Delhi, La.,  Gateway to:   Poverty Point  Archaeological Center
Site of the oldest  pre-historic  civilization in North America
Personal Home Page:,.............HTTP://cust2.iamerica.net/cgodard
Business Home Page:..............HTTP://cust.iamerica.net/ggodard
KA5EJW  Advanced Class Ham       FCC General Class Radiotelephone

Quality Tuner Service.... HTTP://cust2.iamerica.net/cgodard/QualityLinks.htm

Quote:


>: There is a method which works, though it may sound a bit kludgy.  Create
>: a BAT file, and execute the QB4.5 program from it.  If the QB4.5 program
>: needs to run another program, then it can create a temporary file.  When
>: the QB4.5 program exits, the BAT file can check for the existence of the
>: temporary file.  If it exists, then the BAT file deletes the temporary
>: file and runs the second program.

>: Another more flexible possibility is that the QB4.5 program create
another
>: BAT file, and the original BAT file can test for its existence, and CALL
>: it if it exists.  This way the QB4.5 program can easily cause any other
>: program of any name to be executed on the fly, or even do other commands

>: this can happen with a clean screen display.

>Thanks, Judson. Kludgey=good. Very clever solution. :)

>Paul



Tue, 08 May 2001 03:00:00 GMT  
 QB4.5 External Program Launch Problem

Quote:
>Hiya,

>So I was writing a file manager/app launch program in qb4.5, and suddenly
>I had a problem. If I use shell to launch external apps, then according
>to the help files, QB stays resident in memory. I'm doing this for an old
>laptop I resucitated and it doesn't have the memory to spare. How else
>can I launch those external programs?

>Thanks,
>Paul

Here's an excerpt from one of my QBasic 4.5 programs I use for
executing external programs. Note: your program must be a compiled
.exe for this to work!

DECLARE SUB PokeBuffer (buffer$)

Execute:
PRINT " Executing : "; prog$
PokeBuffer prog$
END

SUB PokeBuffer (buffer$)
 buffer$ = LEFT$(buffer$, 14) + CHR$(13)
 length% = LEN(buffer$)
 DEF SEG = &H40
 head% = &H1A
 tail% = &H1C
 Start% = &H1E
 FOR t% = 1 TO length%
  POKE Start% + (t% - 1) * 2, ASC(MID$(buffer$, t%, 1))
 NEXT t%
 POKE tail%, Start% + (t% - 1) * 2
 POKE head%, Start%
 DEF SEG
END SUB



Tue, 17 Jul 2001 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Launch external program

2. How to launch an external program by VBscript ?

3. !!!!!!!!!!!HELP - Launching External Programs - URGENT!!!!!!!!!!

4. Launching external Windows Programs

5. Launching external programs and grabbing their output

6. Access and launching external programs

7. Trying to confirm external program launch

8. Help on launching external program...

9. Launching external programs from Visual Basic

10. Launching External Programs

11. Launching an external program

12. Problem Launching and recalling external apps

 

 
Powered by phpBB® Forum Software