M MrBcx Member Licensed User Longtime User Jun 24, 2014 #1 I understand that specifying a return type at the end of a SUB declaration makes it a FUNCTION. Can someone please explain to me how to invoke a user defined string function like this? Sub Foo (Arg as String) as String Return Arg End Sub
I understand that specifying a return type at the end of a SUB declaration makes it a FUNCTION. Can someone please explain to me how to invoke a user defined string function like this? Sub Foo (Arg as String) as String Return Arg End Sub
NJDude Expert Licensed User Longtime User Jun 24, 2014 #2 Like this: B4X: MsgBox(Foo("Say hello back to me"), "") Or B4X: Msg = Foo("Hi there") MsgBox(Msg, "") Upvote 0
Like this: B4X: MsgBox(Foo("Say hello back to me"), "") Or B4X: Msg = Foo("Hi there") MsgBox(Msg, "")
M MrBcx Member Licensed User Longtime User Jun 24, 2014 #3 Thank you NJDude ... that's what I thought. I'm trying to use a user-defined string function (SUB), in a listview event, to modify a global string but the global string never receives the expected value - instead it get changed to an empty string. Baffling ... Upvote 0
Thank you NJDude ... that's what I thought. I'm trying to use a user-defined string function (SUB), in a listview event, to modify a global string but the global string never receives the expected value - instead it get changed to an empty string. Baffling ...
NJDude Expert Licensed User Longtime User Jun 24, 2014 #4 In that particular case you might not need to use RETURN, just change the value of that variable on the SUB. Upvote 0
In that particular case you might not need to use RETURN, just change the value of that variable on the SUB.