Computer Science Canada Percentage/Progress Bar |
Author: | vertozia [ Thu Jan 11, 2007 1:40 pm ] |
Post subject: | Percentage/Progress Bar |
Hey there, i am making a progress bar for my main menu for my sumarative project. Here is the code that i have, notice that in the second code, the progress bar shows, and the nubers grow when the whole bar finishes. Quote: setscreen ("graphics")
setscreen ("offscreenonly") colorback (black) cls color (white) for h : 1..maxx by 1 for j : 1 .. 100 by 1 for i : 1..9 by 1 delay(5) View.Update cls Draw.FillBox (1,1,h,60,white) View.Update delay(5) put j,".",i end for end for end for Quote: setscreen ("graphics") setscreen ("offscreenonly") colorback (black) cls color (white) for j : 1 .. 100 by 1 for i : 1 .. 9 by 1 for h : 1 .. maxx by 1 delay (5) View.Update cls Draw.FillBox (1, 1, h, 60, white) View.Update delay (5) put j, ".", i end for end for end for thanks in advance |
Author: | Miketron [ Thu Jan 11, 2007 2:19 pm ] | ||
Post subject: | RE:Percentage/Progress Bar | ||
I have made a simpler loader. You can change the delay to make it go slower, change the count to make it shorter/end earlier, and you can make the count go up different, for example whenever something is loaded, etc.
Cervantes says: Please use code tags |
Author: | vertozia [ Thu Jan 11, 2007 8:55 pm ] | ||||
Post subject: | Re: Percentage/Progress Bar | ||||
i understnd what you did, but that wasnt quite my problem, the problem is that when the progree bar works, the percentage displayed doesent move, then when you switch the lines of code arround, the text moves, but the bar doesent. See for yourself, even when using your code, only one displays, either the text, or the bar. have a look,
but when you put this piece of code in the end, only the bar is displayed, why is that?
I am only assuming that either the one on the bottom or top is the dominant process or that the problem is with the timing of the process exectution. |
Author: | Miketron [ Thu Jan 11, 2007 10:50 pm ] | ||
Post subject: | Re: Percentage/Progress Bar | ||
Both were not running at the same time, Turing goes from top to bottem, "forking" is to make 2 processes run at the same time. Hope this helped. |
Author: | Clayton [ Thu Jan 11, 2007 10:55 pm ] |
Post subject: | Re: Percentage/Progress Bar |
gaaaaahh! Don't use processes!!! You have no way of knowing if that loading bar is going to finish at the same time as your actual loading is. Instead, integrate the drawing of the bar in the loop that you are loading in. |
Author: | lord [ Thu Jan 11, 2007 11:03 pm ] |
Post subject: | Re: Percentage/Progress Bar |
lol loris..................................u .................. nvm the top part it not to all only to one..... anyways u dont need fork!!!!!! or a process.... make the bar first then make a percentage thing so it fit with in the bars time limit all u need is 1 for loop |
Author: | vertozia [ Thu Jan 11, 2007 11:52 pm ] |
Post subject: | Re: Percentage/Progress Bar |
thanks for the help, although the code given works, why not use it? and lord, "the guy" who knows my name, is this sid? when i put it within the loop under the same FOR variable, it only displays one process. Thanks to every1, i donated some bits to you |
Author: | Clayton [ Thu Jan 11, 2007 11:58 pm ] |
Post subject: | Re: Percentage/Progress Bar |
Throwing an egg off of a cliff to crack it open works, are you going to use that? The point is, just because something works doesn't necessarily mean you should use it. |