In article <02f401bf8a53$e4b74d40$7ac036d2@pavilion>, you wrote:
>It may help to write a little test program, like this:
Here is what I want to do:
>From a DOS batch file that looks like this
rebol -sqw trim.r %1 %2
I want to run my script that trims the white space and
detabs the input file. The input file would be %1 the
output file will be %2.
I did get the command line thing to work now, not sure how or
why tho. Maybe some thing else was wrong in Windoze95 that
day?
Is there a simpler way to read/load/write from a file name
that is in a variable that what I'm doing here?:
---------------
REBOL [
Title: "trim and detab file"
Date: "Fri Mar 10 13:50:06 2000:"
]
; Manual says to use system/script/args
; [EMAIL PROTECTED] says to use system/options/args
; seems to work the same under Windoze95 either way:
;args: parse system/script/args none
args: parse system/options/args none
file_name_in: first args
file_name_out: second args
read_file: join "read ^(25)"file_name_in
print read_file ; for debugging
write_file: rejoin ["write ^(25)"file_name_out" data"]
print write_file ; for debugging
data: do read_file
detab data
trim data
do write_file
---------------
It does what I want but only as long is every thing is the
same directory.
I want to be able to run my trim.bat file from any place and
have it located in N:\UTL\ which is in my DOS Path.
If I put rebol.exe and trim.r in N:\UTL\, while I'm trying
to run from N:\C\ and my batch file reads, which is also
located in N:\UTL\:
N:\UTL\rebol -sqw N:\UTL\trim.r %1 %2
If I do "trim 00410/textfile.in 00410/textfile.out", while
located in C:\N\ (00410 is below me, ie. N:\C\00410).
I get "Access Error: cannot open /N/UTL/00410/textfile.in". Of
course it can't because that file is not there. Whats with
this behavior and how do I fix it?
Printing out the strings read_file and write_file show me
what I expect to see "read %00410/file.in" and
"write %00410/file.out data".