I would like to be able to pass a view (like a button or edit text) to a subroutine and to be able to determine what the view's "name" is.
B4X:
Dim Button1 as button
SubRoutine(Button1)
Sub SubRoutine(Ctl as view)
MsgBox("The view's name is: " & clt.name, "")
End Sub
The above code snippet is hypthetical because the Name property doesn't exist. Is there a way to acquire the view name without putting it into the Tag or other property?
Thanks,
Rusty
So you are expecting SubRoutine to return Button1 as a string?
The problem is that Button1 is not really the name of the view, it is just a reference. We could call it ButtonRose = Button1, and both variables will refer to the same view.
Yes, that is what I was hoping for.
I'd like to know the name of the view, if that were possible.
So the Sub routine would show "ButtonRose" in your example.
Ideally, I'd like to know which Activity (layout) the button resides and the button's (text) name.
Thanks,
Rusty