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 / A question about Variable usage

Author
Message
General Sephiro
21
Years of Service
User Offline
Joined: 27th Sep 2004
Location:
Posted: 27th Apr 2006 02:43 Edited at: 27th Apr 2006 02:45
There is a command Str$() which will turn a numerical value into a string.

Is there a command that will turn a string into a numerical Value?

I've tried Int() but that expects a real number, any ideas?

Edit}------
Remembered doing it in V.B. using a val command, tried it out in DBC works ^-^

I should really touch up on my DBC commands...

Bluestar4
20
Years of Service
User Offline
Joined: 19th Dec 2005
Location: USA
Posted: 2nd May 2006 04:34
yes there is :
its the val() function
it returns an integer from the string it recieves. for example if you had a string variable called yourstring$ and an integer variable called somevariable you could use it like this :
somevariable=val(yourstring$)

SYNTAX:
Return Value=VAL(String)

Bluestar4~
nojbox87
21
Years of Service
User Offline
Joined: 26th Jun 2005
Location: England
Posted: 2nd May 2006 22:10
Quote: "Edit}------
Remembered doing it in V.B. using a val command, tried it out in DBC works ^-^

I should really touch up on my DBC commands"


I am a Christian and I know that God loves me. That is what makes my life so great!
Underworld 1020
22
Years of Service
User Offline
Joined: 2nd Mar 2004
Location: NY, USA
Posted: 4th May 2006 02:51
I almost did the same thing .

Login to post a reply

Server time is: 2026-07-07 00:48:38
Your offset time is: 2026-07-07 00:48:38