請問如何將變數儲存並比較?
當條件滿足時,將第一次數值紀錄,再次滿足時,將第二數值紀錄,並且比較第一次與第二次數值。
我不知道用NumArray是否正確,我一直無法將第一次數值保存下來,具體如下,
Array: NumArray[10](0);
if oscValue < 0 and oscValue > oscValue[1] and oscValue[1] < oscValue[2]
then begin
value1 = oscValue[1];
value2 = lowest(low,3);
end;
NumArray[1] = value1; //紀錄第1次的oscValue[1]
NumArray[2] = value2; //記錄第1次3根低點
NumArray[3] = //紀錄第2次的oscValue[1]
NumArray[4] = //記錄第2次3根低點
//比較兩次的oscValue[1]與3根低點
if NumArray[1] < NumArray[3] and NumArray[2] > NumArray[4] then ret = 1;
end;
5 評論