Bob said:
I have a function that returns a True or False to the Sub. But what i
actually want to do is return True or False and a number. How is this
possible?
There are (at least) two ways to do this.
Usually the simplest way is to return one of the values as the result of the
procedure, and allow the user to provide a variable as a parameter which
will receive the other value. For example, you could set your function up as
follows:
Public Function DoSomething(ByRef ReturnValue As Integer) As Boolean
ReturnValue = 10
Return True
End Function
When you call this, whichever variable you supply as the ReturnValue
parameter will be populated with the value 10 (because the variable was
passed By Reference instead of By Value). The boolean return value works as
normal.
Another way you could do this is by returning a structure or a class which
contains the two values. This is useful in some circumstances but for
something as simple as you appear to be doing, a ByRef variable is probably
the easiest solution to implement and use.
Hope that helps,