Returning Arrays?

excaliber
09-03-2003, 05:44 PM
Is it possible for a function to return an array of values (specifically, an array of Bytes)? Here is my current code.


Public Function bAdd(ByRef b1() As Byte, ByRef b2() As Byte, ByRef bOut() As Byte) As Boolean


You pass it three arrays total (which can all be the same if you wish), and bOut() is the result array.

To call it, it looks something like this:


bAdd b1(),b2(),bFinal()


What I want is something more 'traditiona', like this:


bFinal() = bAdd(b1(),b2())


Any hope, or am I stuck passing the array both ways instead of setting the function? Thanks

Thinker
09-03-2003, 05:46 PM
Public Function bAdd(ByRef b1() As Byte, ByRef b2() As Byte) As Byte()

excaliber
09-03-2003, 07:18 PM
Ahh. Thank you, that works splendidly. :)

A-Dam
09-03-2003, 07:35 PM
Why all the explicit ByRefs?

Rockoon
09-03-2003, 10:46 PM
Why all the explicit ByRefs?

Doesnt hurt to be explicit does it?

I'm not as explicit as this guy but someimes its important that something be passed by value. In those cases I am explicit about every single parameter to the function.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum