fizbim
09-24-2002, 07:06 PM
How do I return a "Byte" type array from a function ? These bytes are byte size binary data 00-FF and may or may not be ASCII.
Here is my code.
***************************************************
Public Sub MySub()
Dim ByteArray() as Byte
Dim temp1 as byte
Dim temp2 as byte
Dim temp3 as byte
myByteArray = myFunctionCall(somevariable)
temp1 = ByteArray(0) ' should be 01
temp2 = ByteArray(1) ' should be 02
temp3 = ByteArray(2) ' should be 03
End Sub
Public Function myFunctionCall(ByVal DontCare) as Byte()
Dim TempArray() as Byte
TempArray(0) = 1
TempArray(1) = 2
TempArray(3) = 3
myFunctionCall = TempArray
End Function
****************************************************
Here is my code.
***************************************************
Public Sub MySub()
Dim ByteArray() as Byte
Dim temp1 as byte
Dim temp2 as byte
Dim temp3 as byte
myByteArray = myFunctionCall(somevariable)
temp1 = ByteArray(0) ' should be 01
temp2 = ByteArray(1) ' should be 02
temp3 = ByteArray(2) ' should be 03
End Sub
Public Function myFunctionCall(ByVal DontCare) as Byte()
Dim TempArray() as Byte
TempArray(0) = 1
TempArray(1) = 2
TempArray(3) = 3
myFunctionCall = TempArray
End Function
****************************************************