Android Question Sub Overload or Override

imgsimonebiliato

Well-Known Member
Licensed User
Hello,
I need to create 2 new Sub with the same name, so the user can use one or the other.
Is it possible?
 

MikeH

Well-Known Member
Licensed User
No, but you can send a value to the sub and then upon entering the sub do an if/then or select/case depending on that value.
 
Upvote 0

imgsimonebiliato

Well-Known Member
Licensed User
Yes, it could be a possibility but the code isn't written in the best way
 
Upvote 0

DonManfred

Expert
Licensed User
Last edited:
Upvote 0

imgsimonebiliato

Well-Known Member
Licensed User
That I want to create:
B4X:
Sub create Txt (t as text)
Sub create Txt (t as text, g as gravity)
 
Upvote 0

MikeH

Well-Known Member
Licensed User
Use:
B4X:
Sub create Txt (t as text, g as gravity)
and when you dont need the second value just send null e.g. create("Here`s some text", null)
 
Upvote 0
Top