Help with multidimensional arrays  [SOLVED]

Questions about MultiCharts and user contributed studies.
wegi
Posts: 114
Joined: 02 Jun 2009
Has thanked: 4 times
Been thanked: 12 times

Help with multidimensional arrays

Postby wegi » 27 Dec 2017

Hi,

i need to store values in an two dimensional array.
but i don´t now how to work with the array functions, because they need an array index, with is one dimensional

example, try to store 2 at position 3, 1
normally i would do this like: array[3][1] = 2

The function array_setfloatvalue needs an array name and an index. What is the index in my case?

Code: Select all

//declare an two dimensional array, with 5 entries of length 2
Array: stats[5,2](0);

//How to save value 2.0 at position 3 , 1 [3][1]
array_setfloatvalue(stats, ?, 2.0 );




thanks

Wegi

User avatar
TJ
Posts: 6638
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 971 times
Been thanked: 1919 times

Re: Help with multidimensional arrays

Postby TJ » 27 Dec 2017

Try this:

Code: Select all


stats[ 3, 1 ] = 2.0 ;

These users thanked the author TJ for the post:
wegi

wegi
Posts: 114
Joined: 02 Jun 2009
Has thanked: 4 times
Been thanked: 12 times

Re: Help with multidimensional arrays  [SOLVED]

Postby wegi » 27 Dec 2017

Thank TJ, it´s working.
i gues i had to work with this array functions, but it can be so simple :-)


Return to “MultiCharts”