OPEN command help
Moderators:Administrator, Global Moderator
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
Hi Brent; you're doing this backwards. Lets say you enter "taco" for your filepath$.hi. ok i used this:
INPUT "What file do you want to copy"; filepath$
dir$ = filepath$ + " C:\DOS"
SHELL dir$
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
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
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.....
Re: OPEN command help
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.