Greg, Brett, Thanks for your suggestions and advice. While Rebol is certainly powerful it seems to have plenty of quirks waiting to trip the unwary - maybe it gets better the more you get into it!
I still could not get the following type of array element assignment reference to work (this was my original approach):- ; define array example-array: array/initial 10 "" ; define index idx: 3 ; try to set element at offset defined by index value example-array/:n : "data" Different syntax required? Thanks John ----- Original Message ----- From: "Brett Handley" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, November 21, 2001 11:43 PM Subject: [REBOL] Re: Newbie query on array indexing > Hi, > > First off creating the array "example-array" is done like this: > > example-array: array 10 > > This gives you 10 NONEs in a block. To get an array of 10 zeroes use: > > example-array: array/initial 10 0 > > And a side issue (heads up). You are going to get caught if you think you > will get ten different strings with this - you actually get ten references > to the same string: > > example-array: array/initial 10 "" > insert example-array/1 "test" > probe example-array > > > Now for indexing into the array. > If I use a subscript "indx" here are some methods to access the array: > > example-array: array/initial 10 0 > > poke example-array indx 42 > > example-array/:indx > > pick example-array indx > > And as Gregg showed you can use the normal series functions. Because > actually ARRAY is a function that > returns a block. > > >> type? array 3 > == block! > > Brett. > > -- > 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.
