Home   Help Search Login Register  

Author Topic: add "marker" to array  (Read 559 times)

0 Members and 1 Guest are viewing this topic.

pangzi

  • Guest
add "marker" to array
« on: 17 Jan 2003, 12:38:01 »
Is there a way to create an array consisting of markers??
i tried
A)
WpArrayinf_1 = []
WPArrayinf_1 = WpArrayInf_1 + "inf_1Wp1"
the game  complains "generic error in expression"
B)
WpArrayinf_1 = []
WPArrayinf_1 = WpArrayInf_1 + inf_1Wp1
the game doesn't complain, but i cannot read out the array later on ( probably because it recards inf_1Wp1 as an object)


Any answer would be very much appreciated
Thanx for reading :)

Offline uiox

  • Contributing Member
  • **
Re:add "marker" to array
« Reply #1 on: 17 Jan 2003, 13:50:35 »
You can add 2 arrays :  [0, 1, 2] + [1, 2, 3] , result is [0, 1, 2, 1, 2, 3]

But you can't add a variable to an array : [0, 1, 2] + MyVar = an Error

So

WPArrayinf_1 = WpArrayInf_1 + ["inf_1Wp1"]

pangzi

  • Guest
Re:add "marker" to array
« Reply #2 on: 18 Jan 2003, 11:39:05 »
thanks!  ;D
I just forgot the brackets (["..."]). works fine now.
So if you want to add a single element to an array it has to be declared as a one dimensional array. Doesn't make much sense to me ???