Need serious help

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!
Post Reply
Telgarius
Newbie
Posts: 1
Joined: Tue Apr 26, 2005 5:59 am

Need serious help

Post by Telgarius »

I have a computer that i store all my old dos games on. I would like to
write a program in qbasic that allows me to show all the games so i can
pick one. I know how to write this program but i cant figure how to get
it to run the certain game...can i do this or atleast make it goto the
directory where the game is? please help.
User avatar
lurah-
Veteran
Posts: 206
Joined: Mon Nov 01, 2004 10:47 am
Location: Finland
Contact:

Post by lurah- »

Have you tryed "RUN" command?

Depending how much your program uses ram, it might be better to use *.bat
file?
User avatar
Michael Calkins
Veteran
Posts: 76
Joined: Tue Apr 05, 2005 8:40 pm
Location: Floresville, Texas
Contact:

Post by Michael Calkins »

To change directory:
CHDIR
or
SHELL "CD\"+dirname$

To run a small game:
SHELL doscommand$

To run a large game, here is how I would do it:
Use a BAT file to run your QBASIC program. Something like this:

@echo off
:loop
if exist temp.bat del temp.bat
c:\dos\qbasic.exe /run myprog.bas
if exist temp.bat call temp.bat
if exist temp.bat goto loop

Then, have your QBASIC program write temp.bat with the command to execute your game. The advantage to this is that QBASIC.EXE is not still taking up memory.
Regards,
Michael
Bring on the Maulotaurs! oops...
I like to slay Disciples of D'Sparil...
Post Reply