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 / making a 10-dgit score

Author
Message
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 22nd Jul 2009 00:13
i need to get a small score (less than 10 digits) to be 10 digits long by filling in the spaces before with zeroes

of I turn the score into a string, then shouldnt I be able to say

while len(score$)<10
score$="0"+score$
endwhile

i did that and for some reason it's putting the zeroes at the end rather than the beginning, what did I do wrong?

That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 22nd Jul 2009 00:16
nvm, i got it (all i needed to do was ask about ti on here and the answer came to me)

Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 22nd Jul 2009 00:18 Edited at: 22nd Jul 2009 00:20
[EDIT}

too late!

Enjoy your day.
Brick Break
User Banned
Posted: 22nd Jul 2009 00:18 Edited at: 22nd Jul 2009 00:19
What are you talking about? It works perfectly!
EDIT: 2 posts too late.

WINNER list:
Latch, Lee Bamber, TDK, TheComet
Thanks for the help!
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 22nd Jul 2009 00:22
right, i was being stupid

i made a function for this, but right before i ended the function i turned the string into an integer then used endfunction str$(score)

DDDDUHHHHHHHHHHHHHHHH

BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 22nd Jul 2009 00:50
Or, you could have 0's be defaulted and put in every space, then put the Numbers OVER it (right justified) with an opaque background. Might take some fudging but it could work just as well.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 22nd Jul 2009 00:53
not a bad idea bn2, but sounds slower than just editing the variables to contain the 10 digit score

Login to post a reply

Server time is: 2024-05-20 04:23:10
Your offset time is: 2024-05-20 04:23:10