Skip to main content
GameDev.net gamedev.net
🔒 Locked

Another nOOb question

Started by IceBear Dec 25, 2001 at 1:36 PM 3 replies 550+ views
Original Post
IceBear
IceBear
Someone knox of a function who can convert strings to int and viceversa with Delphi? lets say I have a String := ''567'' and I want to convert String[0] int integer so ''5'' in n integer or I am I suppose to do it myself ?
Zimond
Zimond
for the whole string :

n := inttostr(string[0]);

for just one part :

n := inttostr(copy(string[0],1,1);

Edited by - Zimond on December 25, 2001 3:50:27 PM
MarkyD
MarkyD
Whoops!

There''s also a StrToInt function, which should have been used in the previous example.

Zimond, if ya wanna edit your post, I''ll edit mine and we can pretend that this little whoopsie never happened...

~ There''s no substitute for failure ~
Zimond
Zimond
damn... argh... did not see what i have written

uhmm... just got the wrong one i think
can someone delete this thread?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.