/" 只是给progress bar 的code
Sub RenderProgressBar(ByVal intMaxValue As Integer, ByVal intProgress As Integer, ByVal intLeftPos As Integer, ByVal intTopPos As Integer)
/"display result
Dim strResult As String
/"给多少percent progress 的counter
Dim intPercent As Integer
/“如果已经到了max progress…就display出result
If (intMaxValue > 0) Then
intPercent = Math.Round((intProgress / intMaxValue) * 100, 0)
If intPercent >= 10 Then
strResult = “| “ & intPercent & “% |” & StrDup(intPercent \ 10, “=”) & StrDup(10 - (intPercent \ 10), ” “) & “|”
Else
strResult = “| “ & intPercent & “% |” & StrDup(10, ” “) & “|”
End If
Else
/" 如果不是max progress, display 出在prosess中的percentage
intPercent = intProgress
strResult = “| “ & FormatNumber(intPercent, 0) & ” |”
End If
Console.CursorVisible = False
Console.SetCursorPosition(intLeftPos, intTopPos)
Console.Write(strResult)
Console.CursorVisible = True
End Sub