Android Question Using item name instead of the index number

rleiman

Well-Known Member
Licensed User
Longtime User
Hi Everyone,

I have seen coding like this:

B4X:
Activity.RemoveViewAt(3)

Is there a way to do something like this:

B4X:
Activity.RemoveViewAt(ReturnIndexNumber("MyView"))

It would make the coding easier to read if I can use a view name instead of a number.
 

Beja

Expert
Licensed User
Longtime User
Sorry I didn't come here to disappoint you, but I don't know.
You can go around Cape Town though..
Assign a name to each index number as integer
B4X:
DIM MyView as integer
MyView = 3
Activity.RemoveViewAt(MyView)
Note: take away the string quotations from "MyView" since it is Integer variable.

Hope that works for you
 
Upvote 0
Top