W
William Foster
Good evening all,
I was wondering if there is a way to do a function or different sub
routine that returns two or more values.
I usually use a function to return a boolean value, however, this
sometimes requires me to undertake two functions. I would like to do it
in one operation.
I have thought that I could get the function to reutrn a string, then
simply break-up the string into seperate chunks that mean different
things, but I thought I would ask to see if there is a neater way to do
this.
As an example I would like to return a boolean and an integer from a
function, i.e:
Private Sub Query()
Dim Answer, Answer_Part_1, Answer_Part_2 as String
Answer = Working_Out(Blah, Blah, Blah)
Answer_Part_1 = Left(Answer,3)
Answer_Part_2 = Right(Answer,3)
End Sub
Private Function Working_Out(ByVal Blah1 as String,ByVal Blah2 as
String,ByVal Blah3 as String) as String
Dim Return_String as String
Return_String = "Yes" & 123
Working_Out = Return_String
End Function
Any assistance you may be able to provide would be greatly appreciated.
Yours sincerely,
William Foster
I was wondering if there is a way to do a function or different sub
routine that returns two or more values.
I usually use a function to return a boolean value, however, this
sometimes requires me to undertake two functions. I would like to do it
in one operation.
I have thought that I could get the function to reutrn a string, then
simply break-up the string into seperate chunks that mean different
things, but I thought I would ask to see if there is a neater way to do
this.
As an example I would like to return a boolean and an integer from a
function, i.e:
Private Sub Query()
Dim Answer, Answer_Part_1, Answer_Part_2 as String
Answer = Working_Out(Blah, Blah, Blah)
Answer_Part_1 = Left(Answer,3)
Answer_Part_2 = Right(Answer,3)
End Sub
Private Function Working_Out(ByVal Blah1 as String,ByVal Blah2 as
String,ByVal Blah3 as String) as String
Dim Return_String as String
Return_String = "Yes" & 123
Working_Out = Return_String
End Function
Any assistance you may be able to provide would be greatly appreciated.
Yours sincerely,
William Foster