首页 > 解决方案 > 将新的 ifclause 添加到过程后出现调试错误“;预期”

问题描述

在将ifclausefor Art 添加到 MasterReport 以乘以 Netto 总计乘以在信用发票-1中获得-ve结果后,我得到了一个; expected错误指示器,它跳到它之后的程序。

错误消息的图像

这可能是一个非常愚蠢的错误,但目前我无法解决这个问题。评论新的 ifclause 将解决这个问题,所以它就是这样。

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;

标签: pascalscriptfastreport

解决方案


这是错误的(4× begin,但只有 3× 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 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;

推荐阅读