我用了動態陣列儲存數值
Array_SetMaxIndex(Array, Count);
那我想要把陣列裡的數值給畫出來
plot1(Array[1]) plot2(Array[2]) plot3(Array[3])
那我要寫多少行plot才能叫到Array[count]
plot?(Array[count])
我用了動態陣列儲存數值
Array_SetMaxIndex(Array, Count);
那我想要把陣列裡的數值給畫出來
plot1(Array[1]) plot2(Array[2]) plot3(Array[3])
那我要寫多少行plot才能叫到Array[count]
plot?(Array[count])
Hello Y0,
您需要針對陣列的大小分別撰寫所需的plot。
舉例來說:
var: count(0);
array:NumArray[](0);
if time <120000 then count = 3 else count = 5;
Array_SetMaxIndex(NumArray, Count);
plot1(NumArray[1]);
plot2(NumArray[2]);
plot3(NumArray[3]);
if time >= 120000 then begin
plot4(NumArray[4]);
plot5(NumArray[5]);
end;
12點以前 NumArray 只會有3個位置,所以就是plot1 ~ plot3,12點以後則會多plot4跟plot5。
但如果我陣列是未知大小的話呢?
像是陣列儲存今天每次創高的價格
我不知道今天會創高幾次所以就無法得知陣列大小
所以不知道會plot多少次
Hello Y0,
就小幫手所能想到的,您的需求應該無法達成。
plot的數量需要是可知的才能夠撰寫。
3 評論