[REBOL] Re: Newbie query on array indexing
From: jrdrp:blueyonder at: 22-Nov-2001 10:14
Hi Tim,
Thanks for your examples. Sorry if I was not too clear on last post - I did
already check out and understand (I hope) all techniques mentioned by Greg
and Brett and noted the initialisation behaviour with strings, pointers etc.
IMO it would be nice if "unusual" behaviour like this were highlighted in
the Rebol documentation.
My outstanding query was trying to assign a value to an array element using
path syntax with subscript variable. Console session extract below.
Thanks
John
>> arr-test: array 10 ""
== ""
>> loop 10 [append arr-test copy ""]
== [none none none none none none none none none none "" "" "" "" "" "" ""
"" ""]
>> arr-test/1: "Entry1"
== ["Entry1" none none none none none none none none none "" "" "" "" "" ""
"" ""
""]
>> arr-test/3: "Entry3"
== ["Entry1" none "Entry3" none none none none none none none "" "" "" "" ""
"" "
]
>> n: 3
== 3
>> print arr-test/:n
Entry3
>> arr-test/:n:
AmendedEntry3"
** Syntax Error: Invalid word -- :n:
** Near: (line 1) arr-test/:n: "AmendedEntry3"