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.

Newcomers DBPro Corner / Need help with centering a string

Author
Message
jaykav99
15
Years of Service
User Offline
Joined: 30th Jul 2009
Location:
Posted: 30th Jul 2009 23:22 Edited at: 30th Jul 2009 23:54
Sorry misleading title, i meant to ask how do i make each number disappear i have the centering part down.

Atleast i think it would be a string. I am of course a newbie to DB I bought myself a book and Im working through the chapters. I have typed up a sample of coding from the book that just does a simple countdown and prints text. But I'd like to add my own lil twist. So i changed the font, text size and position. But the one thing i cant figure out is with the count down after each number is presented i want it to disappear as the next number shows up.Below is the coding

set text font "forte"
set text size 40
center text 320,180, "Count down to liftoff..."

for x= 10 to 0 step -1
set cursor 320,250
print x
sleep 900
next x
center text 320,210,"Blast off!"
wait key
zeroSlave
15
Years of Service
User Offline
Joined: 13th Jun 2009
Location: Springfield
Posted: 31st Jul 2009 01:03 Edited at: 31st Jul 2009 01:06
Put a CLS after the 'sleep 900' and move the 'center text 320,180, "Count down to liftoff..."' after the FOR statment

eg:



This way, it clears the screen after each FOR loop and places everything back on the screen.

There's something in this room that makes you can't speak well.
jaykav99
15
Years of Service
User Offline
Joined: 30th Jul 2009
Location:
Posted: 31st Jul 2009 01:44
Worked perfectly, thank you very much. I know I am new at this but even i cant belive i didnt try that. I've already seen it so many times in the books.

But again thank you for the help.
zeroSlave
15
Years of Service
User Offline
Joined: 13th Jun 2009
Location: Springfield
Posted: 31st Jul 2009 03:17
No prob. I have found that it is sometimes the smallest things that cause the biggest headaches. Especially after you realize what you were missing. I do it all the time.

There's something in this room that makes you can't speak well.

Login to post a reply

Server time is: 2024-11-25 04:33:53
Your offset time is: 2024-11-25 04:33:53