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

[REBOL] Re: to-char

From: carl:cybercraft at: 12-Feb-2002 18:14

Hi Jason, Just a note to point out you didn't need to make 'letter local in your function as it's automatically made local to 'foreach's block. ie...
>> foreach letter "abc" [print letter]
a b c
>> print letter
** Script Error: letter has no value ** Near: print letter Same with 'for and so on. Even so, for sanity's sake I don't recomend you do much of the following kind of stuff...
>> for n 1 3 1 [prin [n ": "] for n 1 3 1 [prin n] print ""]
1 : 123 2 : 123 3 : 123 (: On 11-Feb-02, Jason Cunliffe wrote:
> ; Is this what you want? > to-charblock: func[aword [string!] /local charblock letter][ > charblock: [] > clear charblock > foreach letter aword [ > append charblock letter > ] > return charblock > ] > h: to-charblock "hello" > ; to access >> print h/1 etc.. > hth > ./Jason
-- Carl Read