I am trying to store the position of a label within a row/column
I have the following in principle...
B4X:
Type Harry(col As Byte, row As Byte)
Dim pos as Harry
Dim Tom as Label
...
pos.col=x : pos.row=y
...
Tom(pos, "abc")
...
Sub Tom(loc as Harry, sEvent as String)
Dim Dick As Label
Dim Dick.Tag As Harry ''Error unknown type Tag. Missing library?
Dick.Initialize(sEvent)
brk.Tag=loc
Tag works if I use a simple array instead of type.
All items used appear in the dropdown lists i.e. when typing Dim brk.Tag As Harry, Tag and Harry were offered.
What is wrong please?
Not quite true. It works but cannot be retrieved correctly. I still need help.
The code is now...
B4X:
Type Harry(col As Byte, row As Byte)
Dim pos as Harry
Dim Tom, snd as Label
...
pos.col = x : pos.row = y
...
Tom(pos, "abc")
...
Sub Tom(loc as Harry, sEvent as String)
Dim Dick As Label
Dick.Initialize(sEvent)
Dick.Tag = loc '[I]save label's position as col and row[/I]
pnl.AddView(Dick, ... ...)
End Sub
Sub abc_Click
snd = Sender
pos = snd.Tag '[I]Retrieve the label's position as col and row[/I]
...
End Sub
I can see the col and row in Dick.Tag after it is stored. But when retrieved from Sender the row col are shown as incorrect last used values. Is there something about Tag that does not permit Type or is Sender the problem or am I the problem? No error is shown.