I'm not sure where I went wrong here. I'm getting a syntax error on the second set of "END ELSE BEGIN":
IF AgingMethod = AgingMethod::"Due Date" THEN BEGIN
PeriodEndingDate[2] := PeriodEndingDate[1];
FOR j := 4 TO 5 DO
PeriodEndingDate[j] := CALCDATE('-('+PeriodCalculation+')',PeriodEndingDate[j-1]);
END ELSE BEGIN
FOR j := 3 TO 5 DO
PeriodEndingDate[j] := CALCDATE('-('+PeriodCalculation+')',PeriodEndingDate[j-1]);
END ELSE BEGIN
FOR j := 2 TO 4 DO
PeriodEndingDate[j] := CALCDATE('-('+PeriodCalculation+')',PeriodEndingDate[j-1]);
END;
PeriodEndingDate[5] := 0D;
CompanyInformation.GET;
GLSetup.GET;
FilterString := Customer.GETFILTERS;
0
Comments
you can only have one "ELSE" per "IF"- statement.
Regards,
Willy
it does the 4 to 5 line else
it does the 3 to 5 line.
How do you expect it to get to the 2 to 4 line?
Are you trying to do more like a case statement?
(Quick example)
CASE AgingMethod = AgingMethod::"Due Date":
BEGIN
PeriodEndingDate[2] := PeriodEndingDate[1];
FOR j := 4 TO 5 DO
PeriodEndingDate[j] := CALCDATE('-('+PeriodCalculation+')',PeriodEndingDate[j-1]);
END;
case AgingMethod = AgingMethod::"Doc Date":
begin
FOR j := 3 TO 5 DO
PeriodEndingDate[j] := CALCDATE('-('+PeriodCalculation+')',PeriodEndingDate[j-1]);
end;
case AgingMethod = AgingMethod::"trans Date":
begin
FOR j := 2 TO 4 DO
PeriodEndingDate[j] := CALCDATE('-('+PeriodCalculation+')',PeriodEndingDate[j-1]);
END;
PeriodEndingDate[5] := 0D;
CompanyInformation.GET;
GLSetup.GET;
FilterString := Customer.GETFILTERS;
http://www.BiloBeauty.com
http://www.autismspeaks.org
http://www.BiloBeauty.com
http://www.autismspeaks.org