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 / Converting String to Numeric

Author
Message
Kanzure
23
Years of Service
User Offline
Joined: 19th Feb 2003
Location:
Posted: 23rd Mar 2003 04:31
I have an array, and it is 10 by 10. It reads data from a file, 1, or a 2, maybe a 3. (tile engine ) It loads it as a$ or something into the array, so the array is a variable. Then I have the proggy read from the array at x,y and do something if the number is ___...But, since it is put into a STRING instead of a number, well, it doesn't work.

When I val(the_array$(x,y)) it gives weird numbers that ARE NOT 1, 2, or 3...


Help!!!
~Morph
Owner of MultiCode.NET and Multi2k.NET.
Nothing is something, and something is then nothing. Life is an illusion.
PiratSS
23
Years of Service
User Offline
Joined: 18th Oct 2002
Location:
Posted: 23rd Mar 2003 04:41
try it like so:


that should do it

Cheers.

1PH J00 C4|\| U|\|dER$T@|\||) +|-|I$, j00 |-|@\/3 4lR3Ady w0|\|! - p1r@T$$
Kanzure
23
Years of Service
User Offline
Joined: 19th Feb 2003
Location:
Posted: 23rd Mar 2003 04:45
oaky..
I'll try it, thankx for the quick response .

~Morph
Owner of MultiCode.NET and Multi2k.NET.
Nothing is something, and something is then nothing. Life is an illusion.
Kanzure
23
Years of Service
User Offline
Joined: 19th Feb 2003
Location:
Posted: 23rd Mar 2003 04:47
Nope, the val() gives *REALLY* weird numbers like 0, 1, or -1, -3.3439204828439024 etc...

~Morph
Owner of MultiCode.NET and Multi2k.NET.
Nothing is something, and something is then nothing. Life is an illusion.
Kanzure
23
Years of Service
User Offline
Joined: 19th Feb 2003
Location:
Posted: 23rd Mar 2003 04:49
FYI - I'm reading from a file so the code is:


~Morph
Owner of MultiCode.NET and Multi2k.NET.
Nothing is something, and something is then nothing. Life is an illusion.
PiratSS
23
Years of Service
User Offline
Joined: 18th Oct 2002
Location:
Posted: 23rd Mar 2003 04:50
ok, can you post the whole snippet?

Thx,

Cheers.

1PH J00 C4|\| U|\|dER$T@|\||) +|-|I$, j00 |-|@\/3 4lR3Ady w0|\|! - p1r@T$$
Kanzure
23
Years of Service
User Offline
Joined: 19th Feb 2003
Location:
Posted: 23rd Mar 2003 04:51

I would normally be doing something with the paste image, but im just seeing what it prints out for now .

~Morph
Owner of MultiCode.NET and Multi2k.NET.
Nothing is something, and something is then nothing. Life is an illusion.
Kanzure
23
Years of Service
User Offline
Joined: 19th Feb 2003
Location:
Posted: 23rd Mar 2003 05:49
Is there a way to "read integer 1, a" instead of "read string 1, a$" ????

~Morph
Owner of MultiCode.NET and Multi2k.NET.
Nothing is something, and something is then nothing. Life is an illusion.
Kanzure
23
Years of Service
User Offline
Joined: 19th Feb 2003
Location:
Posted: 23rd Mar 2003 17:46
help? Anybody? O_o

~Morph
Owner of MultiCode.NET and Multi2k.NET.
Nothing is something, and something is then nothing. Life is an illusion.

Login to post a reply

Server time is: 2026-06-11 13:13:42
Your offset time is: 2026-06-11 13:13:42