Tools Links Login

Text Progress Bar

Give this function a number from 0 to 100, and it will generate a cool progress bar made of text!

Original Author: HyperHacker

Inputs

A number from 0 to 100. (Using a bigger value will cause the bar to extend.)

Returns

A string containing a progress bar made of text.

Code

Function MakePercentBar(ByVal Value As Long) As String
Dim i As Long
MakePercentBar = "["
For i = 1 To ((Value - 1) 10)
  MakePercentBar = MakePercentBar + "-"
Next i
MakePercentBar = MakePercentBar + "|"
For i = 10 To ((Value - 1) 10) + 2 Step -1
  MakePercentBar = MakePercentBar + "-"
Next i
MakePercentBar = MakePercentBar + "]"
End Function

About this post

Posted: 2003-06-01
By: ArchiveBot
Viewed: 141 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.