Ver Mensaje Individual
  #6  
Antiguo 07-07-2007
Avatar de jhonny
jhonny jhonny is offline
Jhonny Suárez
 
Registrado: may 2003
Ubicación: Colombia
Posts: 7.058
Reputación: 30
jhonny Va camino a la famajhonny Va camino a la fama
Pero siempre podremos hacer nuestra función personalizada .
Código Delphi [-]
 
function TForm1.EsNumero(Numero: String): Boolean;
var
  i :Integer;
begin
  i := 0;
  Result := True;
  while ((i <= Length(Numero)-1) and (Result = True)) do
  begin
    inc(i);
    Result := IsNumeric(Numero[i]);
  end;
end;
Para usarla es:
Código Delphi [-]
 if EsNumero(StringGrid1.Cells[x,y]) then
  begin
    ShowMessage('Es Numerico¡');
  end
  else
  begin
    ShowMessage('Es Alfanumerico¡');
  end;

Nota: IsNumeric pertenece a la unidad IdGlobal.Pas
__________________
Lecciones de mi Madre. Tema: modificación del comportamiento, "Pará de actuar como tu padre!"

http://www.purodelphi.com/
http://www.nosolodelphi.com/
Responder Con Cita