Hey how efficient is ByRef? It's a pointer argument right? So I would say it'd take up a Long (4 bytes)?
For example,
say I have a procedure in a module that does work depending on the form specified.
Below are two versions of this function, do which one is more efficient, or do they perform the same?
1) Passing the whole Form with ByRef
Public Sub HandleForm(ByRef frmForm As Form)
Select Case frmForm.hWnd
Case frmTest1.hWnd
...
Case frmTest2.hWnd
...
End Select
End Sub
2) Passing only the form handle
Public Sub HandleForm(llFormHWnd As Long)
Select Case llFormHWnd
Case frmTest1.hWnd
...
Case frmTest2.hWnd
...
End Select
End Sub


Reply With Quote
