Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

starting qbasic programs 1

Status
Not open for further replies.

jon842002

Programmer
Oct 24, 2001
2
0
0
US
I have successfully created my first QBasic program and everything is running fine. However, to start the program, I have to open up its code through QBasic and use the Run command. What I would like to do is have an icon that when opened leads directly runs the program. This is so that other people who use the program do not have to see the code. If someone could help me with this program I would greatly appreciate it.
thank you,
Jon
 
u can create a batch file containing this 2 lines:

@echo off
qbasic /run theprog.bas

but once the program finishes it will return to qbasic

another way is to use quickbasic to compile it to .exe ----------------------------------------
There's no good nor evil, it's all in the mind.
 
you could compile the program into a .exe prgram and then you could make a shortcut on your desktop/program manger.
 
Hi,
if you end the program with

SYSTEM

it will return to the calling system(ie. DOS).
******
This batch file calls the bas file and then does a dir command

echo Start batch file
qbasic /run test.bas
dir
echo END batch file


The basic file looks like this

REM This is test.bas called by a batch file
PRINT "In Basic file"
SYSTEM

Hope this helps Pappy
You learn something everyday.
 
U could create a windows shortcut. Just right mouse click on the Windows desk top, select "NEW", then select "Shortcut" from the pull down menu. When the blan shortcut appears, right mouse click on it, select properties, the enter the following:

CMD line: C:\xxxxxx\QBASIC.exe /RUN c:\xxxxxx\yyyyyyyy.bas

where:
C:\xxxxxx= the directory qbasic is located;
yyyyyy= the name of your program.

You can also select other windows characteristics (i.e.
an Icon type, a program title, etc...).

Endin the program will be tricky. I tried the "system" command and it only bounces me back to the QBasic envionment. I'd like to find a command that would shutdown
the application- totally- from windows, preferrably. Njoy.

Jedi Sends
-----
Don't bother running, you'll only die tired!
 
hey jedi,
read this:

if you end the program with

SYSTEM

it will return to the calling system(ie. DOS).
^^^^^^^^^^^^^^^^^^^^^^
if you will run the .bas file inside the qbasic environment then obviously it will return to same. But if u will run it from outside the environment(dos command prompt) then you will return to the prompt only.
Hope you get my point.

--guneet
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top