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 / Isn't there a faster and easier way to do this?

Author
Message
The Dream Keeper!
21
Years of Service
User Offline
Joined: 9th Oct 2003
Location: Netherlands! HOLLAND!
Posted: 13th Dec 2003 15:03
Hey guys, i'm having a little problem with storing the data of an $ string to a # string. And i don't want to typ hondreds lines so.. does anyone know how i can do this faster, easier? etc.?



Thanks!
Dream Keeper

Bring fun to life!!!!!
WTCoder
21
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 13th Dec 2003 16:28
Try this:

leduur1# = val(tientaluur$)

leduur1# will equal tientaluur$ no matter what it's value.
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 14th Dec 2003 22:08
what if tientaluur$ = "ABC"?

Hamish McHaggis
22
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 15th Dec 2003 00:33
Then you can't do it. Floats only store numbers, not strings.

Do you bite your thumb at me sir?

Athelon XP 1600 Plus - Nvidia Geforce MX400 - 256mb RAM
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 15th Dec 2003 01:47
go figure, i just try to contridict everything everyone says, j/k

born2respawn
21
Years of Service
User Offline
Joined: 11th Nov 2003
Location: UK
Posted: 16th Dec 2003 01:27
I imagine there's a "is numeric" check available. You'd have to test but would would only need an IF statement.

(I'm a little rusty, bear with me)
Steele
21
Years of Service
User Offline
Joined: 25th Oct 2003
Location: Somewhere over the rainbow
Posted: 29th Dec 2003 17:45 Edited at: 29th Dec 2003 17:49
A little late probably but here goes:


This checks for zero through nine and will only get the first character so if you have "abc" or some invalid string, you will get a -1. Now, if you have "123" or even "4bc32" it will only get the first character, the "1" in the first string or "4" in the second and convert those to 1 and 4.

I hope this helps you.

-- I straddle the line between genius and insanity. Guess which side I am on now? --

Login to post a reply

Server time is: 2025-05-22 06:01:23
Your offset time is: 2025-05-22 06:01:23