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

strings and things

 [1/6] from: depotcity:telus at: 10-May-2001 13:10


Hello again. Back to basics again. New question. here is a string read from a text file... str: {word1 word2 "a string"} How does one take str and make it usable? eg: blk: [word1 word2 "a string"] where word1 and word2 are words.. and a string is a, er, string? I know I knew this a some point, but suffering from Rebol overload. Thanks TBrownell

 [2/6] from: joel:neely:fedex at: 10-May-2001 15:19


Hi, Terry, One possibility is below. -jn- Terry Brownell wrote:
> here is a string read from a text file... > > str: {word1 word2 "a string"} > > How does one take str and make it usable? > > eg: blk: [word1 word2 "a string"] > >> str: {word1 word2 "a string"}
== {word1 word2 "a string"}
>> blk: load join "[" [str "]"]
== [word1 word2 "a string"]
>> foreach item blk [print type? :item]
word word string

 [3/6] from: chris::ross-gill::com at: 10-May-2001 16:48


Hi Terry & Joel,
> >> str: {word1 word2 "a string"} > == {word1 word2 "a string"}
<<quoted lines omitted: 5>>
> string > >>
Actually, all that is necessary is to do:
>> str: {word1 word2 "a string"}
== {word1 word2 "a string"}
>> blk: load str
== [word1 word2 "a string"]
>> type? blk
== block! - Chris

 [4/6] from: ryanc:iesco-dms at: 10-May-2001 13:43


do or load, depending on if you want to use it now or later. Terry Brownell wrote:
> Hello again. > Back to basics again.
<<quoted lines omitted: 12>>
> [rebol-request--rebol--com] with "unsubscribe" in the > subject, without the quotes.
-- Ryan Cole Programmer Analyst www.iesco-dms.com 707-468-5400 I am enough of an artist to draw freely upon my imagination. Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world. -Einstein

 [5/6] from: thundrebol::yahoo at: 10-May-2001 14:02


Maybe I didn't read this thread carefully, but won't this work?:
>> str: {word1 word2 "a string"}
== {word1 word2 "a string"}
>> blk: to-block str
== [word1 word2 "a string"] //Ed --- Ryan Cole <[ryanc--iesco-dms--com]> wrote:

 [6/6] from: depotcity:telus at: 10-May-2001 14:21


We have a winner! TBrownell

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted