Hello.
My array show me twice the integer values.
What is the reason for this mistake?
Variable:
ArrLen -> Integer
i -> Integer
ArrMoq - Integer
Code:
ArrLen := 0;
FOR i := 1 TO ARRAYLEN(ArrMoq) DO
IF ArrMoq <> 0 THEN
ArrLen += 1;
IF "Sales Line".MOQ <> 0 THEN BEGIN
ArrLen += 1;
IF (ArrLen <= 8) THEN
ArrMoq[ArrLen] := "Sales Line".MOQ;
END;
The result is like this:
10
10
20
20
etc...
The correct way would be:
10
20
etc...
I check the document in Sales Line table, but the result was only two rows with MOQ -> 10 and 20. I don't understand why my array is making them twice.
-1
Answers
ArrLen := 1;
FOR i := 1 TO ARRAYLEN(ArrMoq) - 1 DO
IF ArrMoq <> 0 THEN
ArrLen += 1;
IF "Sales Line".MOQ <> 0 THEN
ArrMoq[ArrLen] := "Sales Line".MOQ;