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

[REBOL] Setting array variables Re:(2)

From: rryost:home at: 25-Aug-2000 11:47

I've added some more stuff to show how to use a variable for a row number. ----- Original Message ----- From: <[rryost--home--com]> To: <[list--rebol--com]> Sent: Friday, August 25, 2000 11:37 AM Subject: [REBOL] Setting array variables Re:
> Here's an illustrative console session that addresses your question: > >> dat: array [2 3]
== [[none none none] [none none none]]
>> dat/1: [1 2 3]
== [[1 2 3] [none none none]]
>> dat/2: 3 4 5
== 5
>> dat
== [[1 2 3] 3]
>> dat/2: [3 4 5]
== [[1 2 3] [3 4 5]]
>> change dat/1 777
== [2 3]
>> dat
== [[777 2 3] [3 4 5]]
>> change at dat/1 2 888
== [3]
>> dat
== [[777 888 3] [3 4 5]] ; here's how to use a variable for a row number.
>> a: 2
== 2
>> dat/:a
== [3 4 5]
>> change at dat/:a 2 999
== [5]
>> dat
== [[777 888 3] [3 999 5]] Seems easier, no?