sábado, 12 de mayo de 2007

es numero INT un STR ???

function IsStrANumber(NumStr : string) : bool;


//********* comprueba si un combo es numero
function IsStrANumber(NumStr : string) : bool;
begin
result := true;

try
StrToInt(NumStr);
except
result := false;
end;

end;
//****



if IsStrANumber(edit2.Text)=false then
begin
showmessage('El campo UNIDADES debe de ser un número.');
exit;
end;

No hay comentarios: