martes, 29 de diciembre de 2009

comprobar que un textbox sea numero isnum

function IsStrANumber(NumStr : string) : bool;


//***********************
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: