|
-
May 31st, 2007, 01:41 AM
#10
Re: [02/03] Progress Bars
 Originally Posted by robertx
I use the pass by reference method as follows:
Code:
Public Sub UpdateProgressBar(ByRef myProgressBar As ProgressBar)
Dim i As Integer, iRecordCount As Integer
'Set record count here
iRecordCount = 100000
For i = 0 To (iRecordCount - 1)
'do something here
'increment progress bar
myProgressBar.Value = ((i + 1) * 100) / iRecordCount
Application.DoEvents()
Next
End Sub
There is no reason to pass the parameter by reference. You can set properties of the ProgressBar just the same when passing it by value. If you pass it by reference you are enabling the method to pass out a different ProgressBar than what was passed in. That is obviously not what you want.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|