VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Text Progress Bar

by HyperHacker (2 Submissions)
Category: String Manipulation
Compatability: VB Script
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (8 Votes)

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

Inputs
A number from 0 to 100. (Using a bigger value will cause the bar to extend.)
Code Returns
A string containing a progress bar made of text.

Rate Text Progress Bar

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

Download this snippet    Add to My Saved Code

Text Progress Bar Comments

No comments have been posted about Text Progress Bar. Why not be the first to post a comment about Text Progress Bar.

Post your comment

Subject:
Message:
0/1000 characters