
09-24-2002, 08:39 PM
|
 |
Senior Contributor
|
|
Join Date: Jul 2001
Location: /dev/meow
Posts: 1,180
|
|
Re: Returning arrays from function
Well, I'm not entirely sure what you're asking, but couldn't you skip the variable swapping processes(in MySub, and myFunctionCall) altogether? Ex:
Code:
Public Sub MySub()
Dim ByteArray() as Byte
Dim temp1 as byte
Dim temp2 as byte
Dim temp3 as byte
temp1 = myFunctionCall(0) ' should be 01
temp2 = myFunctionCall(1) ' should be 02
temp3 = myFunctionCall(2) ' should be 03
End Sub
Public Function myFunctionCall(ByVal DontCare) as Byte()
If DontCare = 0 then myFunctionCall(DontCare) = 1
If DontCare = 1 then myFunctionCall(DontCare) = 2
If DontCare = 2 then myFunctionCall(DontCare) = 3
'Or myFunctionCall(DontCare) = DontCare + 1
End Function
Hope that helps you somehow.
Arigato,
Gamer X
|
|