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

[REBOL] Text list problems

From: geza67::freestart::hu at: 5-Jul-2001 22:27

Hello fellow REBOLers ! Maybe it's trivial but Ican't get through this ;-) : I have a text list ('tl), with some of the 'tl/lines being multiline (i.e. containing a newline "^/" ). Now if I query the selection with index? find tl/lines tl/picked when choosing single line text list members, everything is OK but incase of these multiline 'tl/lines members 'none is found ... Although I loaded 'tl with _strings_ (and probe-ing 'tl/lines justifies that they are represented really as strings in the text list!), 'tl/picked is a block with _words_ , not with the original strings. E.g.: probe tl/lines == [ "...." "this is a string" "..." ] probe tl/picked == [this is a string] ???!!! Now if a member has a newline in it strange things happen: probe tl/lines == ["..." "this is^/ a string" "..."] probe tl/picked == [this is a string] ???!!! This last example was _really_ printed out on the REBOL console as a block of _words_ with a _newline_ in position! For transforming back this weird tl/picked 'to-string doesn't work: == "thisisastring" Transformation via 'form neither succeeds: == "this is a string" (note, the newline "^/" disappears , it is converted to a space! ) I would simply need the block brackets to be "converted" to string delimiters and leaving that newline char intact. How could be this achieved ? Other questions: Is there an alternative getting back not the content (in 'tl/picked) but directly the numeric index position(s) of the selection? I can't believe that the VID was designed so badly (but surely not well documented!) that one should expose a nasty "index? find ... " search overhead to get the index of the selection. How can I change the default multiple choice behavior of a text list to a strict one-choice-only scheme ? I thankfully appreciate your kind input! Geza