Console_ProgressBar

<< Click to Display Table of Contents >>

Navigation:  ThinBASIC Modules > Console >

Console_ProgressBar

 

Description

 

Draws and update a char based progress bar.

 

Syntax

 

Console_ProgressBar(PBID, xPos, yPos, Width, Color, MinVal, MaxVal, CurrentValue)

 

Returns

 

Parameters

 

Name

Type

Optional

Meaning

PBID

Number

No

A unique number internally used to identify the Progress Bar. Use value from 1 to 255

xPos

Number

No

X start position of the progress bar

yPos

Number

No

Y start position of the progress bar

Width

Number

No

Length of the progress bar (the length between [ and ])

Color

Number

No

Color to be used.
Use or to set foreground and background console colors.

Example: %CCOLOR_BBLACK | %CCOLOR_FLIGHTCYAN

MinVal

Number

No

Minimum value

MaxVal

Number

No

Maximum value

CurrentVal

Number

No

Current value

 

Remarks

 

Character progress bar will show a char (default is *) inside a double square brackets.

Followed by current value and max value

Followed by percentage

 

Example:

 

Restrictions

 

See also

 

Console Module, Console_Box

 

Examples

 

Dim Count1 As Long

Dim Max1   As Long value 10

Dim Count2 As Long

Dim Max2   As Long value 10

Dim Count3 As Long

Dim Max3   As Long value 1000

 

'---Display 3 progress bar

For Count1 = 1 To Max1

  Console_ProgressBar(1, 10, 10, 50, 24, 1, Max1, Count1)

  For Count2 = 1 To Max2

    Console_ProgressBar(2, 10, 12, 50, 24, 1, Max2, Count2)

    For Count3 = 1 To Max3

      Console_ProgressBar(3, 10, 14, 50, 24, 1, Max3, Count3)

    Next

  Next

Next