Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / string to integer function?

Author
Message
toipot2
21
Years of Service
User Offline
Joined: 14th Nov 2003
Location:
Posted: 14th Nov 2003 15:00
i've been looking for some time to find the db equivalent of the C atoi() function (converts a string to an integer) something like this "1" to 1 I think. It's a pretty integral function so i'd be surprised if DBC didn't support it.

Does this command exist? or if not how could I set something up to do it or something simmilar?

Would I have to resort to writing a DLL using MSVC++ 6.0 and if so how would I set it out, I have very limited experience of using C/C++

Any help would be greatly appreciated

Thanks
Nathan
Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 14th Nov 2003 15:43
Val will attempt to convert a string to an integer


a$="123456"
MyNumb=val(a$)
print a$
print MYNumb

Kevin Picone
Play Basic - Visible Worlds - Kyruss II
[url]www.underwaredesign.com[/url]

Login to post a reply

Server time is: 2025-05-21 18:58:52
Your offset time is: 2025-05-21 18:58:52