Tema: Error en UDF
Ver Mensaje Individual
  #1  
Antiguo 02-03-2004
jars jars is offline
Miembro
 
Registrado: mar 2004
Posts: 283
Reputación: 23
jars Va por buen camino
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.
Responder Con Cita