Page 2 of 2

Re: OPEN command help

Posted: Mon Mar 15, 2004 6:38 am
by yacinator
well it would be nice to see the program that i helped to create (unless u r charging money for it)...

Re: OPEN command help

Posted: Mon Mar 15, 2004 3:55 pm
by Artie
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.

Re: OPEN command help

Posted: Sun Mar 21, 2004 11:36 pm
by scorpion
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

Re: OPEN command help

Posted: Sun May 23, 2004 10:41 pm
by Guest
thanks for your help, guys

Re: OPEN command help

Posted: Fri Jun 25, 2004 1:01 am
by BlazeTech
Hey I am 12 and I am making my own GUI. Plus I know RAPIDQ and C++.