Need help with loops
Author |
Message |
fear01
|
Posted: Sat Dec 03, 2005 3:10 pm Post subject: Need help with loops |
|
|
It's me again, uh would anyone like to help me with a loop? problem? I need to know if there is a way to cls some of the stuff in the run window without cls'ing all of it. For example, I want to keep the top half of my program the same while whenever the user types in an answer the bottom half will display the appropriate response then cls itself for another question. Or do I need to run another window when I do this so it will cls all of one of the windows. This is basically for a trivia game in which the top half keeps track of all the questions asked and displays the ones answered correct or incorrect, and the bottom is the half that keeps the score, questions, and the get statements for the user. Thanks for any help given. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Cervantes
|
Posted: Sat Dec 03, 2005 5:11 pm Post subject: (No subject) |
|
|
You could use two windows, though that's rather ugly.
You could Draw.FillBox over half the screen.
code: |
Draw.FillBox (0, 0, maxx, maxy div 2, bgColour)
|
You could put a whole bunch of blank lines:
code: |
for row : maxrow div 2 .. maxrow
locate (row, 1)
put ""
end for
|
|
|
|
|
|
|
milz
|
Posted: Sat Dec 03, 2005 5:17 pm Post subject: (No subject) |
|
|
instead of Clsing all the stuff u don't want, y don't u just name a box, oval, line, etc on it with the background colour. aite |
|
|
|
|
|
Geminias
|
Posted: Sat Dec 03, 2005 10:59 pm Post subject: (No subject) |
|
|
i ran into a problem like this as well, and the way i solved it was to fork a process which continually prints the score to the screen. If you dont know what a fork is look it up in turing help. It will tell you everything you need to know. But a word of caution: forking can cause some unexpected problems visually, so make sure you are very cosmepolitan in this process.. i.e. make sure there's plenty of delay and not a whole lot going on in it. |
|
|
|
|
|
Cervantes
|
Posted: Sun Dec 04, 2005 10:20 am Post subject: (No subject) |
|
|
Geminias wrote: i ran into a problem like this as well, and the way i solved it was to fork a process which continually prints the score to the screen.
Uh oh. |
|
|
|
|
|
Geminias
|
Posted: Sun Dec 04, 2005 4:53 pm Post subject: (No subject) |
|
|
lol okay dont use processes then. |
|
|
|
|
|
codemage
|
Posted: Sun Dec 04, 2005 5:33 pm Post subject: (No subject) |
|
|
Can't you just have a procedure that refreshes the score & etc. whenever you need to? It's a simple bit of code - it wouldn't make your program slow by running it frequently. |
|
|
|
|
|
|
|