Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Firebird e Interbase (https://www.clubdelphi.com/foros/forumdisplay.php?f=19)
-   -   Error en UDF (https://www.clubdelphi.com/foros/showthread.php?t=7938)

jars 02-03-2004 18:10:06

Error en UDF
 
Hola a todos:
Disculpen el primer mensaje, no conocía los formatos.

Trabajo con Delphi 7 y Firebird 1.5.
He creado la siguiente función en una UDF:

Código:

function SecsToFmt(secs: Integer): PChar; cdecl; export;
var
  hh,mm: Integer;
begin
  try
        hh := Trunc(secs/3600);
        secs := secs Mod 3600;
        mm := Trunc(secs/60);
        secs := secs Mod 60;
        Result := PChar(Format('%.2d:%.2d:%.2d',[hh,mm,secs]));
  except
        Result := PChar(Format('%d',[secs]));
  end;
end;

La llamo desde IbExpert de la siguiente manera:

select secstofmt(140) from ....

Me sale el error:

arithmetic overflow or division by zero has occurred.
arithmetic exception, numeric overflow,or string truncation

Alguien me puede decir que esta mal?
Gracias.

kinobi 02-03-2004 18:12:53

Hola,

Cita:

Empezado por jars
Disculpen el primer mensaje, no conocía los formatos.

no te preocupes, ya he eliminado tu primer mensaje. Gracias por haberlo reescrito.

Saludos y bienvenido a estos foros.


La franja horaria es GMT +2. Ahora son las 01:28:19.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi