1
I’m trying to figure out a mistake that I don’t know exactly where it’s generated.
whenever I have to open one of the screens of the system it passes by 2 Procedure, (I go through them just below) the First is the FormShow
in it I call the other CalculaSaldoHonorario
.
In CalculaSaldoHonorario
I open a query and until then nothing goes wrong, leaving from CalculaSaldoHonorario
he finishes the FormShow
and soon after the end;
of the error:
--------------------------- Debugger Exception Notification --------------------------- Project MeuSistema.exe raised exception class EConvertError with message ''' is not a valid integer value'. --------------------------- Break Continue Help ---------------------------
I’m using the Unidac in my project.
Follows the codes:
procedure TfrmManutencaoHonorarios.CalculaSaldoHonorario;
var zTotReceber: Currency;
begin
DataModuleGeral2.dtsVerPagamentos.Enabled := False;
DataModuleGeral2.qryVerPagamentos.Close;
DataModuleGeral2.qryVerPagamentos.SQL.Clear;
DataModuleGeral2.qryVerPagamentos.SQL.Add('select * from PAGAMENTOS T1 where T1.NUMERO_PROCESSO = '+QuotedStr(dbeNumero_Processo.Text)+' order by T1.DATA_PAGTO');
DataModuleGeral2.qryVerPagamentos.Open;
// Soma os Pagamentos
zTotPagto := 0;
DataModuleGeral2.qryVerPagamentos.First;
while not DataModuleGeral2.qryVerPagamentos.Eof do
begin
zTotPagto := zTotPagto + DataModuleGeral2.qryVerPagamentosVALOR_PAGTO.AsCurrency;
DataModuleGeral2.qryVerPagamentos.Next;
end;
DataModuleGeral2.qryVerPagamentos.First;
DataModuleGeral2.dtsVerPagamentos.Enabled := True;
edtValorTotalPagto.Text := String(RightStr(AnsiString(' '+FormatFloat('#,###,###,##0.00', zTotPagto)) , 14));
// Encontra o Total a Receber
zTotReceber := DataModuleGeral.tbHonorariosVALOR_TOTAL.AsCurrency - zTotPagto;
if zTotReceber < 0 then zTotReceber := 0;
edtTotalReceber.Text := String(RightStr(AnsiString(' '+FormatFloat('#,###,###,##0.00', zTotReceber)), 14));
end;
Code of FormShow
procedure TfrmManutencaoHonorarios.FormShow(Sender: TObject);
begin
Left := 0;
Top := 144;
if DataModuleGeral.tbHonorarios.Active = True then
begin
DataModuleGeral.tbUsuarios.Open;
DataModuleGeral.tbHonorarios.Last;
end;
VerificaProcessoContrato;
btnPesquisar.SetFocus;
end; // Logo depois que passa por esse end da o erro!
In error it opens the source of System.SysUtils
in that part:
procedure ConvertErrorFmt(ResString: PResStringRec; const Args: array of const); {$IFDEF ELF} local; {$ENDIF}
begin
raise EConvertError.CreateResFmt(ResString, Args);
end;
I isolated the line of these two projects and put in step by step the Debug
the error only occurs if opens the query, after I know CalculaSaldoHonorario
not the error, just the error in the output of the OnShow
and does not appear where it passes before going to the ConvertErrorFmt
.
Quotedstr() Put " " in the process number to do the search will always have process number.
– Edu Mendonça