Getting debug error “; expected” after adding new ifclause to procedure


Getting debug error “; expected” after adding new ifclause to procedure



After adding the ifclause for Art to a MasterReport to multiple the Netto total by -1 for get a -ve result in the credit invoice, I am getting a ; expected with the error indicator jumping to the procedure after it.


ifclause


-1


-ve


; expected



Image of Error Message



It's likely a very stupid error but I can't wrap my head around the problem at the moment. Commenting the new ifclause out will resolve the issue so it's something with that.


procedure FooterSR1OnBeforePrint(Sender: TfrxComponent);
begin
if ( <frxdsqryKopfdaten."MwStNichtAusweisbar"> = 0 ) then
mmoBrutto.Memo.Text := FormatFloat('#,##0.00', EndBrutto ) + ' ' + <frxdsqryKopfdaten."CurrencyString">
else
mmoBrutto.Memo.Text := FormatFloat('#,##0.00', EndNetto ) + ' ' + <frxdsqryKopfdaten."CurrencyString">;
end;

procedure Hauptkopf1OnBeforePrint(Sender: TfrxComponent);
begin
if (<frxdsqryArt."Art"> = 'Gutschrift') then
begin
EndNetto := EndNetto * (-1)
end else begin
EndNetto := EndNetto;
end;
end;
begin
mmoNetto.Memo.Text := FormatFloat('#,##0.00', EndNetto ) + ' ' + frxdsqryKopfdaten."CurrencyString">
end;

procedure BandBankOnBeforePrint(Sender: TfrxComponent);
begin
if <frxdsqryFirma."Bank1"> <> '' then
mmoBank.Visible := False
else
mmoBank.Visible := FALSE;

if <frxdsqryFirma."IBAN1"> <> '' then
begin
mmoIBAN.Visible := FALSE;
mmoBank.Visible := FALSE;
mmoBank.Height := 0
end else begin
mmoIBAN.Visible := FALSE;
mmoBank.Visible := FALSE;
end;
end;





I do not know Fast Report, but your code does not really look like a valid Pascal (Script) code. What's the point of the second begin ... end pair after Hauptkopf1OnBeforePrint? - You should really include a larger code snippet into the question, as your current snippet is most probably not enough to show the problem.
– Martin Prikryl
Jun 29 at 8:54



begin


end


Hauptkopf1OnBeforePrint





Sorry, wasn't too sure about how much to add code wise, I'll edit the post in that regard. That said, the error doesn't occur when the iflcause from the Hauptkopf1OnBeforePrint is removed.
– Tripl3M
Jun 29 at 8:59






Note that you have 4 begin, but only 3 end in Hauptkopf1OnBeforePrint.
– Martin Prikryl
Jun 29 at 9:04


begin


end


Hauptkopf1OnBeforePrint




1 Answer
1



This is wrong (4× begin, but only 3× end):


begin


end


procedure Hauptkopf1OnBeforePrint(Sender: TfrxComponent);
begin
if (<frxdsqryArt."Art"> = 'Gutschrift') then
begin
EndNetto := EndNetto * (-1)
end else begin
EndNetto := EndNetto;
end;
end;
begin
mmoNetto.Memo.Text := FormatFloat('#,##0.00', EndNetto ) + ' ' + frxdsqryKopfdaten."CurrencyString">
end;



Your probably wanted this (but hard to say):


procedure Hauptkopf1OnBeforePrint(Sender: TfrxComponent);
begin
if (<frxdsqryArt."Art"> = 'Gutschrift') then
begin
EndNetto := EndNetto * (-1)
end else begin
EndNetto := EndNetto;
end;
end;
mmoNetto.Memo.Text := FormatFloat('#,##0.00', EndNetto ) + ' ' + frxdsqryKopfdaten."CurrencyString">
end;






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Comments

Popular posts from this blog

paramiko-expect timeout is happening after executing the command

Export result set on Dbeaver to CSV

Opening a url is failing in Swift