B4J Question Set Tag by code

hakha4

Member
Licensed User
Longtime User
Can't find answer in forum how to set tag property in code the way I wan't. I have a bunch of toggle buttons with a common event so I can check selected or not BUT I want to be able to set tag property to a specific togglebutton (from a Sqlite table,that part I can handle). Since tag will be used for other purposes can it be done with 'name' ? How to do this ?? Other way ???

Regards Håkan
 

Daestrum

Expert
Licensed User
Longtime User
B4X:
...
yourToggleButton.Tag = "myTag" ' to set the tag
...
Log(yourToggleButton.Tag) ' to read the tag
 
Upvote 0

hakha4

Member
Licensed User
Longtime User
Thank's for reply. Maybe I was unclear. I need to identify a SPECIFIC togglebutton either from the control's name 'sw_01... 10 etc or from it's text property. Eg.
'find tooglebutton where name is like _01.. (best) OR 'find togglebutton where 'text = "something". In the tag property I'll then write a string (in this case command for setting a rf unit on or off)
Regards Håkan
 
Upvote 0

hakha4

Member
Licensed User
Longtime User
Thank's to Erel's EXCELLENT video on dynamic control's I got a number of Togglebuttons in a pane and I can catch each button state and read values from typed data . When creating the buttons a value is saved in the MS_no variable for identifying each button (1,2,3..to number of buttons).
What I need to do is to set values for some other params saved in the Tag property to a SPECIFIC button after it's been created but how do I get the index from the button I wan't to set a value for ?
Eg. 'find MLS_no where value = ?' (and then set values for other variables)
I've tried a number of approaches but I don't really understand how to extract a specific value from a specific field from my

B4X:
Type buttondata(MLS_varname as String,MLS_location As String,code As String,MLS_no As Int)
Any Help appreciated
 
Upvote 0
Top