Re: Array
- To: mathgroup at smc.vnet.net
- Subject: [mg69250] Re: Array
- From: Peter Pein <petsie at dordos.net>
- Date: Sun, 3 Sep 2006 23:46:44 -0400 (EDT)
- References: <eddptn$3q3$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Bruce Colletti schrieb: > The command: > > {A[1], A[2], A[3]} = {1, 2, 3} > > assigns a value to each A-variable. However, the command: > > Array[A,3] = {1,2,3} > > generates an error message. > > What is the difference between the two lines? > > Thankx. > > Bruce > Hi Bruce, in the first line you evaluated Array[A,3] manually _before_ setting the value(s). The second line fails, because Set has got the attribute HoldFirst and Array is protected. Evaluate[Array[A,3]]={1,2,3} works perfectly. Peter