Author Topic: [Answered] if string is integer  (Read 979 times)

0 Members and 1 Guest are viewing this topic.

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
[Answered] if string is integer
« on: May 12, 2007, 11:17:54 am »
I'll keep this simple. Would somebody please help me on checking of a string is an integer or not? (The string may contain letters, numbers, anything that somebody may type when they press the "t" button.)

EDIT: nevermind... got help
« Last Edit: May 12, 2007, 05:38:52 pm by DorkeyDear »

Offline Quantifier

  • Major
  • *
  • Posts: 70
Re: [Answered] if string is integer
« Reply #1 on: May 15, 2007, 04:43:17 am »
You took effort to edit the post and change the post title to "answered". I don't see the answer. Well?

Offline urraka

  • Soldat Developer
  • Flagrunner
  • ******
  • Posts: 703
Re: [Answered] if string is integer
« Reply #2 on: May 15, 2007, 12:58:12 pm »
Yeah, it seems he got help somewhere else. If that's the case, please post the answer here cause it mught be helpfull for other people.
urraka

Offline mikembm

  • Soldier
  • **
  • Posts: 210
Re: [Answered] if string is integer
« Reply #3 on: May 15, 2007, 07:30:30 pm »
Haven't tested it but this should work.
If not, you get the general idea...

Code: [Select]
var
number: integer;
begin
try
number = StrToInt(your_string);
except
//not an integer
end;
end;