[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Dynamically allocate Array



PureBytes Links

Trading Reference Links

Is it possible to have an array determined at "run time ?"

For example:

Inputs: NumData(3);
Array: Name[NumData](0);
Vars: ComName("");
vars: sd(0);

For Value1 = 1 To NumData Begin
    ComName = GetSymbolName();
    Name[Value1] = ComName;
End;

The "idea" of the above code is to have a chart with N data series, data1,
data2, data3, ..., dataN. The indicator above just takes the number of data
series in the chart as input (I do not know how to figure out how many data
series there are in the chart programatically.) Then, it "allocates" an
array of that size in the input, and gets the Symbol name for each data
series (I don't know how to do this either in EL, I am just pretending that
it does.) Finally, it assignes the symbol name to the corresponding array
sub.

The code above will not verify - I understand that, but I was wondering if
there was a "standard" technique in EL to deal with dynamically sized array
(other than calling a DLL function and having C do it for you.)

Regard,

Ivan