Manage Learn to apply best practices and optimize your operations.

Progress Message Bar Display -- for Those "Long" Program Executions

This script writes to the bottom line of the workspace a progress message, including
[title][percentage complete][graphical bar].

Ideal when you have scripts that wade through large databases and take several minutes to complete. The output looks something like this ... Writing to file... [65%] [|||||||||| ] (The graphics are actually divided into 40 segments) A useful enhancement !
Sub ProgressBar(Message As String,TotalCount As Integer,ActualCount As Integer)

'Divide the total into 40 equal segments and display
Divisions=Round(TotalCount/40,0)
NoSegments=Round(ActualCount/Divisions,0)+1

'Create the number of boxes
OutputBoxes=""
For i=1 To NoSegments
OutputBoxes=OutputBoxes+Chr(7)
Next
For i=NoSegments To 40
OutputBoxes=OutputBoxes+" "
Next

'Display Percentage
Percentage=Trim(Str(Round((ActualCount/TotalCount*100),0)))
If Len(Percentage)=1 Then Percentage="[ "+Percentage+"%]"
If Len(Percentage)=2 Then Percentage="[ "+Percentage+"%]"
If Len(Percentage)=3 Then Percentage="["+Percentage+"%]"

'Create Output Display
If ActualCount >= TotalCount Then
Print "" 'This clears the message at the end of the run
Else
Print Message+" "+Percentage+" ["+OutputBoxes+"]"
End If
End Sub

Dig Deeper on Domino Resources - Part 8

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close