Help with multidimensional arrays  [SOLVED]

Questions about MultiCharts and user contributed studies.
wegi
Posts: 124
Joined: 02 Jun 2009
Has thanked: 5 times
Been thanked: 13 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: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Help with multidimensional arrays

Postby TJ » 27 Dec 2017

Try this:

Code: Select all


stats[ 3, 1 ] = 2.0 ;

wegi
Posts: 124
Joined: 02 Jun 2009
Has thanked: 5 times
Been thanked: 13 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”