Passing a Member of Structure
Posted: 22 January 2010, 0:00 AM
Hello,
I defined a Structure with a large number of members. Some of the members include arrays. I defined a separate function to operate on an array, but don't want to pass the entire Structure to preserve speed. Is this possible? The following example fails to compile:
Appreciate your comments.
Liam
I defined a Structure with a large number of members. Some of the members include arrays. I defined a separate function to operate on an array, but don't want to pass the entire Structure to preserve speed. Is this possible? The following example fails to compile:
Code: Select all
option base 1
Structure bar
Dim i as Integer
Dim a(1 to 3) as Integer
End Structure
Sub Main()
Dim b1 as bar
Dim i as Integer
i = foo(b1.a)
debug.print "i=" & i
End Sub
Function foo(ByRef b() as Integer) as Integer
foo = b(1)+b(2)+b(3)
End Function
Liam