小弟使用下列程式想要確認財報內容是否正確,卻發生了兩個異常,請大大協助確認:
異常1.營收年增月增大於0時,grade對應欄位會計分,但發生了-值也有分數
異常2.grade[17]作為總分計算,但個股計算結果也不如預期
array: grade[17](0);
variables: x(1),y(1);
//grade[1]~[16]為個別分數,grade[17]為總分
Value1 = GetField("月營收月增率","M");
if Value1 > 0 then begin grade[1] = 5; end;
Value2 = GetField("月營收年增率","M");
if Value2 > 0 then begin grade[2] = 5; end;
Value3 = GetField("累計營收年增率","M");
if Value3 > 0 then begin grade[3] = 10; end;
while x < 4 begin
grade[17] = grade[17] + grade[x];
x = x + 1;
end;
if grade[17] >= 5 then ret = 1;
outputfield(1, grade[17], "總分");
outputfield(2, Value1, "月營收月增率");
outputfield(3, grade[1], "月增得分");
outputfield(4, Value2, "月營收年增率");
outputfield(5, grade[2], "年增得分");
outputfield(6, Value3, "累計營收年增率");
outputfield(7, grade[3], "累計營收得分");
於2019/05/19日執行結果如下:


4 評論