Android Question Sub Overload or Override

imgsimonebiliato

Well-Known Member
Licensed User
Longtime 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
Longtime 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
Longtime User
Yes, it could be a possibility but the code isn't written in the best way
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Last edited:
Upvote 0

imgsimonebiliato

Well-Known Member
Licensed User
Longtime 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
Longtime 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