Loading a pathname from command line parameter
[1/3] from: jwirt::toward::com at: 25-Jun-2001 23:42
I need some help fixing the script below.
The command used to start Rabble from the NT command line is:
rebol test.r /g/psa106/NAJun25.Txt
The probe command shows that the value of messagefile is:
/g /psa106 /NAJun25.txt
The question is how can I convert this data series into pathname with
file type file! so that the file can be sent with the email command?
Thank you. John Wirt
*****************************
REBOL [
Title: "Test script"
File: %test.r
Author: "jwirt"
Date: 20-May-2001
Purpose: { Load an email script from command line. }
]
messagefile: load system/script/args
probe messagefile
change-dir %/k/internettools/rebol/
members: load %addresses.txt
send members read %messagefile
[2/3] from: ingo:2b1 at: 26-Jun-2001 10:38
Hi John,
instead of using load, which will create a block out of
your data (test with type? load system/script/args), you
should use 'to-file.
*****************************
[REBOL [
Title: "Test script"
File: %test.r
Author: "jwirt"
Date: 20-May-2001
Purpose: { Load an email script from command line. }
]
messagefile: to-file system/script/args
; -------
probe messagefile
change-dir %/k/internettools/rebol/
members: load %addresses.txt
send members read %messagefile
]
kind regards,
Ingo
[3/3] from: jelinem1:nationwide at: 26-Jun-2001 14:33
I'm not sure why you're using 'load; to automatically parse multiple
arguments? Parsing multiple arguments is a different subject, I think.
Don't use 'load. Just remove it, or replace it with 'copy. Also, placing %
in front of 'message causes a literal interpretation of "message" as a
filename.
Then, to convert the argument received (a string) just use 'to-file.
messagefile: copy system/script/args
probe messagefile
change-dir %/k/internettools/rebol/
members: load %addresses.txt
send members read to-file messagefile
- Michael Jelinek
From: "Wirt, John" <[jwirt--toward--com]>@rebol.com on 06/25/2001 10:42 PM
Please respond to [rebol-list--rebol--com]
Sent by: [rebol-bounce--rebol--com]
To: "Rebol Listserv" <[rebol-list--rebol--com]>
cc:
Subject: [REBOL] Loading a pathname from command line parameter
I need some help fixing the script below.
The command used to start Rabble from the NT command line is:
rebol test.r /g/psa106/NAJun25.Txt
The probe command shows that the value of messagefile is:
/g /psa106 /NAJun25.txt
The question is how can I convert this data series into pathname with
file type file! so that the file can be sent with the email command?
Thank you. John Wirt
*****************************
REBOL [
Title: "Test script"
File: %test.r
Author: "jwirt"
Date: 20-May-2001
Purpose: { Load an email script from command line. }
]
messagefile: load system/script/args
probe messagefile
change-dir %/k/internettools/rebol/
members: load %addresses.txt
send members read %messagefile