Database table into option button

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
theoGA61d2
Posts: 7
Joined: Wed Dec 21, 2011 10:42 am

Database table into option button

Post by theoGA61d2 » Wed Nov 14, 2012 4:55 pm

Hi,

I have a problem figuring out how to do this:

I have a table which has a id and an description

I want to show the user the description is an option or combo button but when the choose an option have the ID as this will be linking in to another table as reference.

Those anybody have an idea how to solve this?

Thanks

Theo

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Database table into option button

Post by sturgis » Wed Nov 14, 2012 5:59 pm

When you query the database, query both items ( of course) with a delimter of some type.

THen you should have a list of items and rows like

my item id 1,1
my item id 2,2

Convert this to an array with split.

split myData by return and comma -- edited to fix horrendous typo.

This gives you an array where the keys are "my item id..." and the value is the id itself

THen you can use "the keys of myData" to populate your button, and
myData[whateverkey] to reference the id.

Post Reply