Public Function MyFunction(ByRef i As Integer, ByRef ds As Dataset) As Boolean If blah then 'Manipulate ds here Else 'Manipulate i here End If Return True 'Return True or False depending End FunctionBack where you called MyFunction, you could then test the values of the integer variable and the dataset variable and do the processing you need to do.
>Public Function MyFunction() As Integer or As Dataset >if blah then >return dataset >else >return 1 'integer value of some kind >end if >End Function>