Home   Help Search Login Register  

Author Topic: How to put values in a vektor?  (Read 509 times)

0 Members and 1 Guest are viewing this topic.

Lihamatti

  • Guest
How to put values in a vektor?
« on: 12 Jul 2004, 20:47:49 »
Sorry if this has been asked before, but how can I put/change values of a vektor. For example if I have a vektor _vek = [1,2,3,4], how can I change number 3 to number 7 (with a scripting command)? like:  _vek select 2 = 7 . That doesn't work but you get what I mean. Thanks

ponq

  • Guest
Re:How to put values in a vektor?
« Reply #1 on: 12 Jul 2004, 20:59:12 »
Uhm, with vektor you mean array?

Lihamatti

  • Guest
Re:How to put values in a vektor?
« Reply #2 on: 12 Jul 2004, 21:09:34 »
Hmmm, I guess so, I'm kind a new to this whole scripting. I need a list of numbers which will be changed (one at a time) during running the script.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:How to put values in a vektor?
« Reply #3 on: 12 Jul 2004, 23:02:25 »
Yes, in this context vektor=array.    (You could also call it a matrix if you wanted.)
Plenty of reviewed ArmA missions for you to play

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:How to put values in a vektor?
« Reply #4 on: 13 Jul 2004, 09:27:12 »
You can change a single element of an array with the set command. eg.

Array set [ element, value ]

So in the above example:

_vek set [2,7]

Just note that the first element in an array is numbered zero. So in your example, 1 is element 0, 2 is element 1, 3 is element 2 etc.
Bit of a pain for those of us that start counting at one :P ;)

Lihamatti

  • Guest
Re:How to put values in a vektor?
« Reply #5 on: 13 Jul 2004, 11:46:37 »
Cool!, thanks a lot Sui!