Hi Petr

I will leave your first puzzle about 'change for someone else to elaborate.

There are various ways to write to an indexed element.  For your example,
the following is the fastest and also fairly easy to read:

>> ar: array/initial [3 4] copy ""
== [["" "" "" ""] ["" "" "" ""] ["" "" "" ""]]

>> i: 2   j: 3
== 3

>> poke pick ar i j "hello"
== ["" "" "hello" ""]

>> ar
== [["" "" "" ""] ["" "" "hello" ""] ["" "" "" ""]]

Hope this helps

Larry


----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 03, 2000 5:26 AM
Subject: [REBOL] Multidimensional arrays ...


> Could anyone elaborate on following, please?
>
> ->> ar: array/initial [3 4] copy ""
> == [["" "" "" ""] ["" "" "" ""] ["" "" "" ""]]
> ->>  change ar/1/1 "adfaf"
> == ""
> ->> ar
> == [["adfaf" "adfaf" "adfaf" "adfaf"] ["adfaf" "adfaf" "adfaf" "adfaf"]
> ["adfaf" "adfaf" "adfaf" "adfaf"]]
>
> How to simply write at any multidimensional array position? ar/:i/:j:
> value doesn't work ...
>
> Thanks,
>
> -pekr-
>

Reply via email to