Page 1 of 1

Is it possible to use command prompt commands with Qbasic?!

Posted: Sun Aug 05, 2007 3:08 pm
by Sinuvoid
How!!!(Title is my question)

Posted: Sun Aug 05, 2007 4:21 pm
by Stoves
SHELL command

example:

SHELL "cd .."

or

SHELL "dir > t.tmp"

etc.

Code using SHELL that checks if a file exists:

Code: Select all

fileExists = 0
SHELL "dir/a/on/b autoexec.bat > t.tmp"

frnum = FREEFILE
OPEN "t.tmp" FOR INPUT AS #frnum
    DO WHILE NOT EOF(frnum) AND fileExists = 0
	fileExists = 1
    LOOP
CLOSE #frnum
	
IF fileExists = 0 THEN
    PRINT "File NOT found."
ELSE
    PRINT "File found."
END IF

Posted: Sun Aug 05, 2007 4:23 pm
by Anonymous
you sure can, use SHELL

Code: Select all

Shell "echo hello"

Shelling around

Posted: Mon Apr 07, 2008 1:38 am
by Kiyotewolf
I solved this problem awhile ago..

First, write a batch file to start QBasic interpreter to run your program, and in the same batch file have it execute another batch file that the QBasic program creates.

If necessary, have the batch file the qbasic program makes set an environment variable that the main batch file can branch off from if set ..

I made a QBasic menu that runs programs, as well as QBasic programs from a list and used the batch file to do the calling so the two programs were not in the memory at the same time.

If you do not understand batch files.. you can either ask me or .. or.. i dunno..

I'm an expert at coding batch files. I have written a few gems in my time.

Kiyote!

Posted: Mon Apr 07, 2008 11:20 am
by burger2227
Your humility is beyond amazing braggart!

excuse me?

Posted: Tue Apr 08, 2008 9:57 am
by Kiyotewolf
Humility?

....


The reason I said I can expertly program batch files is because the zillions of us that have moved on from DOS to Win 3.11 to Win 9x to Vista then realizing how crappy Vista is then to Linux is..

..... how many of us actually remember how to code in *.BAT?

I do..

I was offering my services as I won't make them look like an idiot if I coded for them and they tried it and found a "syntax error" or "command undefined" from DOS or their virtual shell of choice.

I have been able to sneak around the shortcomings of Windows by employing batch files strategically in MIME handling and other stuffs, and am 100% confident in my work.

It's not a matter of boasting, simply a matter of pride. I have reached that point in *.BAT that I'm still striving for in *.BAS.

I will never be as good as other QBasic programmers, I am ALWAYS learning.. but in *.BAT, I have become quite fluent and am not a blithering idiot.

I can even code in TRS-80 Basic if you wanted me to or 6502 Commodore 64 C= Assembly for Christmas Sake if you asked, and even code a real commodore wedge.. so don't get on my case about being cute, I was just reasuring them that I can code in batch and that's final.

Like I said before, flaming is bogus man, and not worth my time..

So... have a donut on me.. and have a guud day dude.

See you in the next issue of QBXpress

Kudos

Kiyote!