Silverfrost Logo About Us | Contact Us
 

Bar format - %Nbr[options]

This format draws a horizontal or vertical bar which is partially filled with a given colour. The first argument is a DOUBLE PRECISION control variable that indicates the extent of the fill. This variable should have a value between 0.0D0 and 1.0D0 inclusive. The second argument is an (r,g,b) colour value given by RGB@. N is used to specify the length of the bar, in average characters, when fully filled.

If options are supplied they should be placed in square brackets and separated by commas. The following options are available:

left_right

Bar is drawn horizontally left to right (default).

right_left

Bar is drawn horizontally right to left.

top_bottom

Bar is drawn vertically from the top.

bottom_top

Bar is drawn vertically from the bottom.

no_border

No bar border is drawn.


The bar is updated by using the window_update@ function. This should be called at suitable intervals to provide a smooth progression. This is illustrated in the following example:

        WINAPP
        INCLUDE <windows.ins>
        INTEGER ctrl
        DOUBLE PRECISION d
        d=0.0
        i=winio@('%ca[Bar format]&')
        i=winio@('Processing .....%2nl&')
        i=winio@('%20br&',d,RGB@(255,255,0))
        i=winio@('%lw',ctrl)
        DO WHILE(d.LT.1.0)
          DO i=1,100000
          END DO
          d=d+0.01
    c---- The data has changed so prompt windows to ---
    c---- update the bar display ---
          CALL window_update@(d)
        END DO
        END

The above program will produce a horizontal bar which will extend to the right as the task proceeds.

 

 

Copyright © 1999-2017 Silverfrost Limited