Thanxs, exactly what I was looking for
/M

-----Ursprungligt meddelande-----
Fr�n: G. Scott Jones [mailto:[EMAIL PROTECTED]]
Skickat: den 2 oktober 2002 11:44
Till: [EMAIL PROTECTED]
�mne: [REBOL] Re: Problems with blocks


From: Mikael
> How can I create blocks in a block like the first code snippet here
> but doing it dynamically like the second exampel?
> d should be the same as b.
>
> b: make block! [["a" "b"]]
> b: append b [["c" "d"]]
> probe b => [["a" "b"] ["c" "d"]]
>
> c: [["a" "b"] ["c" "d"]]
> d: make block! []
> foreach cc c [
> d: append d cc
> ]
> probe d => ["a" "b" "c" "d"]

Hi, Mikael,

A simple refinement to append is all that is needed:
c: [["a" "b"] ["c" "d"]]
d: make block! []
foreach cc c [
    append/only d cc
]
probe d

By the way, it is not necessary to reassign the result to your word, 'd.
Append appends the result to the block (or series) and returns that head as
a convenience.  Using probe d will confirm that you have your result.

Hope that helps.
--Scott Jones

-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.
--
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the
subject, without the quotes.

Reply via email to