Cableguy Expert Licensed User Longtime User Jun 2, 2013 #1 I have 3 returns in a sub, that return a string... Its my knowleage that we don't need to declare the return type for it to work as intented... B4X: Return "Continue" but, just to clarify, how would I declare the return type?
I have 3 returns in a sub, that return a string... Its my knowleage that we don't need to declare the return type for it to work as intented... B4X: Return "Continue" but, just to clarify, how would I declare the return type?
stevel05 Expert Licensed User Longtime User Jun 2, 2013 #2 Just append As Type to the subroutine name: B4X: Sub mysub(Text As String) As String Dim Result As String . . . Return Result End Sub Upvote 0
Just append As Type to the subroutine name: B4X: Sub mysub(Text As String) As String Dim Result As String . . . Return Result End Sub
Cableguy Expert Licensed User Longtime User Jun 2, 2013 #3 stevel05 said: Just append As Type to the subroutine name: B4X: Sub mysub(Text As String) As String Dim Result As String . . . Return Result End Sub Click to expand... thanks... actually appending the "as String" to the sub name did it, no need to dim the result inside the sub Upvote 0
stevel05 said: Just append As Type to the subroutine name: B4X: Sub mysub(Text As String) As String Dim Result As String . . . Return Result End Sub Click to expand... thanks... actually appending the "as String" to the sub name did it, no need to dim the result inside the sub
stevel05 Expert Licensed User Longtime User Jun 2, 2013 #4 Yes it would, but I just put it there for completeness. Upvote 0