BeSly Software Solutions About yab Demos About us Admin


statusbar -- create a progress or status bar

STATUSBAR x1, y1 TO x2, y2, ID$, LeftLabel$, RightLabel$, View$

Use the statusbar to visualize the progress of a long computation process, e.g. installation or search. The statusbar is simply set up with the identifier ID$ at (x1,y1) to (x2,y2) on the view named View$. It takes two labels, LeftLabel$ is shown on the left side above of the statusbar and RightLabel$ is shown on the right side above of the statusbar.

The statusbar will follow the lower right corner of a window in standard layout.

The statusbar should give the user an idea how long a specific process takes. This of course is only useful for processes that take some time. Also having a statusbar that stays for one minute at 5% and then immediatly jumps to 100% should be avoided although this sometimes is not in control of the programmer.

window open 100,100 to 300,150, "Example", "Example"
statusbar 10,10 to 190,40, "MyStatus", "Start", "End", "Example"

while(not instr(message$, "Quit") and i<100)
        i = i + 2
        statusbar set "MyStatus", "Start", "End", i
        sleep 0.05

window close "Example" 

The statusbar is put on top of the example window with the two labels "Start" and "End". Using the statusbar set command, the statusbar is updated regularly to the new calculated value i which is between 0 and 100. 

Related: statusbar set