<<

Contents

Search

>>

 

PROGRESSBAR

 

 

Instruction

 

 

Syntax:

PROGRESSBAR(<Row>,<Column>,<Length>,<Percent>,<Color1>,<Color2>[,<Handle>[,<Text>[,<Range>]]])

 

<Row>

= <NUM-EXPRESSION>

<Column>

= <NUM-EXPRESSION>

<Length>

= <NUM-EXPRESSION>

<Percent>

= <NUM-EXPRESSION>

<Color1>

= <NUM-EXPRESSION>

<Color2>

= <NUM-EXPRESSION>

<Handle>

= <NUM-EXPRESSION>

<Text>

= <STRING-EXPRESSION>

<Range>

= <NUM-EXPRESSION>

 

 

Meaning:

Creates on position <Row>,<Column> a progress bar with the length <Length>.

 

<Percent> specifies how many percent of the bar are shown in the color <Color-2>. The rest of the bar is shown in the color <Color-1>. In the middle of the bar the number <Percent> or <Text> is displayed.

 

By default the standard range from 0 to 100 is used. If the parameter <Range> is specified, a customized range is used. <Percent> then can vary from 0 to <Range>.

 

<Color-1> and <Color-2> are RGB colors.

 

PROGRESSBAR can be used to show the work progress.

 

Parameter:

Row

Row position of the progress bar

Column

Column position of the progress bar

Length

Length of progress bar in columns

Percent

Value must be between 0 and 100.

If <Percent> = -99 the progress bar changes to indeterminate mode.

If <Percent> < 0 and <> -99 or > 100 (or > <Range>), the bar is deleted.

Color1

Basic color of the bar

If <Color1> < 0 or > 255 the standard color applies.

Color2

Color for displaying the percentage

If <Color2> < 0 or > 255 the standard color applies.

Handle

Window depth or handle of a split window or handle of a WINDOWCALL Window

Text

Specifies the text that is displayed on the progress bar. If this parameter is missing the percent value <Percent> is displayed on the progress bar.

Range

Specifies the range. If this parameter is missing the default range 100 is used.

 

Sample:

RGB(6) = 255,255,255

RGB(3) = 255,0,0

PROGRESSBAR(20,10,60,0,6,3)

FOR I% = 1 TO COUNT%

    ...

    PERCENT% = ROUNDED(0) I% * 100 / COUNT%

    PROGRESSBAR(20,10,60,PERCENT%,6,3)

ENDLOOP

…

PROGRESSBAR(20,10,60,-1,6,3) /* delete progress bar

 

// progress bar with 1/10 percent

FOR I% = 1 TO 1000

    P = ROUNDED (-1) I% / 10

    TEXT$ = STRN$(P) + " %"

    PROGRESSBAR (20,2,78,I%,-1,-1,0,TEXT$,1000)

    SLEEP(5)

ENDLOOP

 

// progress bar in indeterminate mode

 

 

// progress bar 10%

 

 

See also:

RGB