Android Question Get Reference from library

imgsimonebiliato

Well-Known Member
Licensed User
Longtime User
Hello,
in the main activity, I often use references to a created library and the code is too repetitive, like this:
B4X:
iGlo.GetValueAsString
iGlo.SetValue
iGlo.Clear
iGlo.GetName
......

Is there, any method like this:

B4X:
Use/With iGlo do
   GetValueAsString
   SetValue
   Clear
   GetName
......
end
 

Cableguy

Expert
Licensed User
Longtime User
if indeed they are repetitive and always the same, why not create a sub?

Something like...
B4X:
Sub doiGlo
iGlo.GetValueAsString
iGlo.SetValue
iGlo.Clear
iGlo.GetName
......
end sub

then in your code all you need to execute these actions is call the sub

B4X:
.....
doIglo
.....
 
Upvote 0
Top