
-----------------------------------
fear01
Sat Dec 03, 2005 3:10 pm

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.

-----------------------------------
Cervantes
Sat Dec 03, 2005 5:11 pm


-----------------------------------
You could use two windows, though that's rather ugly.  

You could Draw.FillBox over half the screen.

Draw.FillBox (0, 0, maxx, maxy div 2, bgColour)


You could put a whole bunch of blank lines:

for row : maxrow div 2 .. maxrow
    locate (row, 1)
    put ""
end for


-----------------------------------
milz
Sat Dec 03, 2005 5:17 pm


-----------------------------------
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
Sat Dec 03, 2005 10:59 pm


-----------------------------------
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
Sun Dec 04, 2005 10:20 am


-----------------------------------
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.

[url=http://www.compsci.ca/v2/viewtopic.php?t=7842]Uh oh.

-----------------------------------
Geminias
Sun Dec 04, 2005 4:53 pm


-----------------------------------
lol okay dont use processes then.

-----------------------------------
codemage
Sun Dec 04, 2005 5:33 pm


-----------------------------------
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.
