OPEN command help

Please use this Board for QBasic related requests ( file research, programming, etc.)

Moderators:Administrator, Global Moderator

User avatar
yacinator
Full Member
Posts:33
Joined:Sun Dec 21, 2003 12:02 am
Re: OPEN command help

Post by yacinator » Mon Mar 15, 2004 6:38 am

well it would be nice to see the program that i helped to create (unless u r charging money for it)...

Artie
Jr. Member
Posts:23
Joined:Fri Feb 06, 2004 12:48 am
Location:Florida
Contact:

Re: OPEN command help

Post by Artie » Mon Mar 15, 2004 3:55 pm

hi. ok i used this:

INPUT "What file do you want to copy"; filepath$
dir$ = filepath$ + " C:\DOS"
SHELL dir$
Hi Brent; you're doing this backwards.  Lets say you enter "taco" for your filepath$.

Your dir$ will become taco C:\DOS, which isn't any kind of DOS command, (or any other.)

Your dir$ needs to be complete.  Lets say you want to end up with this:

COPY C:\taco.txt C:\DOS

Then you would need to do this:

INPUT "What file do you want to copy"; filepath$
(You enter "taco.txt")
dir$ = "COPY C:\" + filepath$ + " C:\DOS"
SHELL dir$

Try that.

Also, if you want to make sure the person entered a file extension, do this:

INPUT "What file do you want to copy"; filepath$
(You enter "taco") Leaving off the extension.
IF RIGHT$(filepath$,4)<>CHR$(46) THEN
 PRINT "You must enter a file extension."
 INPUT "What file do you want to copy"; filepath$
END IF
dir$ = "COPY C:\" + filepath$ + " C:\DOS"
SHELL dir$

There's lots of ways to do an error check, I just did that one real quick to fit into this forum.  Experiment with different techniques.

User avatar
scorpion
Newbie
Posts:8
Joined:Sun Mar 21, 2004 11:26 pm
Contact:

Re: OPEN command help

Post by scorpion » Sun Mar 21, 2004 11:36 pm

the difficult way to copy files within SHELL:

LET file1$ = "in.txt"
LET file2$ = "out.txt
OPEN file1$ for input as #1
OPEN file2$ for output as #1
DO UNTIL EOF(1)
LINE INPUT #1, dummy$
PRINT #2, dummy$
LOOP
CLOSE #1: CLOSE #2

the text in "in.txt" is now dito to "out.txt"
remember that in 1 program the max filenumber is #16

greetZ

Scorpion
....;D.....

Guest

Re: OPEN command help

Post by Guest » Sun May 23, 2004 10:41 pm

thanks for your help, guys

BlazeTech
Newbie
Posts:7
Joined:Mon Jun 21, 2004 9:44 pm
Contact:

Re: OPEN command help

Post by BlazeTech » Fri Jun 25, 2004 1:01 am

Hey I am 12 and I am making my own GUI. Plus I know RAPIDQ and C++.
GSHELL will be a GUI, but Blaze Ultimate will be an OS.

Post Reply