Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Simple question regarding saving strings to files. Re:

From: bhandley:zip:au at: 15-Aug-2000 11:13

Howdy,
>> help save
USAGE: SAVE where value /header header-data DESCRIPTION: Saves a value or a block to a file or url. SAVE is a native value.
>> help mold
USAGE: MOLD value DESCRIPTION: Converts a value to a REBOL-readable string. MOLD is a native value.
>> help load
USAGE: LOAD source /header /next /library /markup DESCRIPTION: Loads a file, URL, or string. Binds words to global context. LOAD is a native value.
>> load {"stringa" "stringb" "stringc"}
== ["stringa" "stringb" "stringc"] So you can do this....
>> save %your-file1.txt ["string a" "string b" "string c"] >> print load %your-file1.txt
string a string b string c Or this (which retains the containing block in the file)...
>> write %your-file2.txt mold ["string a" "string b" "string c"] >> print load %your-file2.txt
string a string b string c Brett.