• Earn real money by being active: Hello Guest, earn real money by simply being active on the forum — post quality content, get reactions, and help the community. Once you reach the minimum credit amount, you’ll be able to withdraw your balance directly. Learn how it works.

Delphi Funcion IsNumber [By Expermicid]

Status
Not open for further replies.

Expermicid

Leech
User
Joined
Oct 23, 2011
Messages
285
Reputation
0
Reaction score
255
Points
63
Credits
0
‎13 Years of Service‎
95%
Hola a todos. Estoy hace tiempo haciendo un proyecto en delphi para aprender nuevas cosas. Pero se me habia complicado xD

Hace unos dias lo segui y necesitaba una funcion que tome un numero de un edit y valide que realemente sea un numero, asi que hice esta funcion que es muy basica pero sirve xP

[lenguaje=delphi]function IsNumber(Num : string): boolean;

var

i: integer;

valor: boolean;

const

nums : string = '0123456789';

begin

valor := true;

for i := 1 to length(Num) do

if pos(Num, nums) = 0 then


begin



valor := false;



break;



end;



Result := valor;



end;[/lenguaje]


 


Saludos :)


 


PD: el proyecto que estoy haciendo muy pronto lo publicare xD


 
Last edited by a moderator:
Status
Not open for further replies.
Back
Top