
01-15-2010, 10:06 AM
|
|
Freshman
|
|
Join Date: Jan 2010
Posts: 26
|
|
Returning multiple values from function
|
I know this is a dumb question, but I'm new to VB. I have a function that I want to return more than one value for. I've googled this, but can't find a good/working example. I'm using VB6 if that matters. Here is an example (don't mind my crazy sense of humor). I've read that I'm suppose to do (in this example) a RETURN WhyNot, but VB is barfing on that statement
Public Function AreWeThereYet (MilesToGo As Integer, ByVal WhyNot As String) As Boolean
If MilesToGo=0 Then
AreWeThereYet = True
WhyNot = ""
Else
AreWeThereYet = False
WhyNot = "Because Daddy doesn't drive fast enough"
End If
End Function
|
|