I have the below handler which I am using to populate the options within an option button.
Firstly it deletes all the options within the button, next it reads the contents of a fld into a Variable then places them into the button.
The fld that populates the Variable is on a different card to the btn (hence the card references)
The problem is sometimes the contents of the button display odd with funny code displayed after the
actual contents of the button. I have attached an image so you can see what I mean (the shape after the 12345). this happens on both the Simulator and the actual device.
it also seems to be random, sometimes it works just fine... seems to be if I access the button really fast after this handler has ran this is where the issue occurs.
code below
Code: Select all
on setPilotNameButton
-- Deletes current contents of Btn PilotID from Card ScoreCard
repeat with x = 1 to the number of lines of text of button "PilotID" of card "ScoreCard"
delete line x of button "PilotID" of card "ScoreCard"
delete line x of button "PilotID" of card "EditScores"
end repeat
-- place data from Pilots fld from card SetupMode into variable then insert into Btn PilotID on card ScoreCard
put the text of field "Pilots" of card "SetupMode" into tPlist
repeat with x = 1 to the number of lines of tPlist
put line x of tPlist into line x of button "PilotID" of card "ScoreCard"
put line x of tPlist into line x of button "PilotID" of card "EditScores"
end repeat
--
end setPilotNameButton