Returning multiple values from a function

How can I return multiple values from a function? Values could be different types.

Thanks

[404 byte] By [JobLot] at [2007-12-16]
# 1

Make your function return array of values. Or
Pass in parameters ByRef rather than ByVal

PankajBanga at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 2
You can also create a structure defining all the values you need, and pass the structure.
Same for a class. You can make a new class, and pass that instead.
Dustin_H at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 3
Hi,

You could return an ArrayList. This offers that flexibility that you can store objects of different types as well the size can vary if needed.

Having a ref or out parameter is another option for achieving the same.

Regards,
Vikram

Vikram at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic General...