MobilePick: how to display the 'text' (not line number!)

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
glenn9
Posts: 223
Joined: Wed Jan 15, 2020 10:45 pm
Location: Europe

MobilePick: how to display the 'text' (not line number!)

Post by glenn9 » Wed Oct 28, 2020 9:22 am

Hi everyone,

After many days of experimenting with no success I wanted to check if anyone knew of a way to display the 'selectedText' of the option selected when the mobile menu displays on a device.

At present I can only get it to show the line number selected!

I've tried various permutations of the following code but with no success!

Grateful for any help,

Many thanks,

Glenn

Code: Select all

on mouseup
   
   put the colorNames into tColorNames
   
   mobilePick tColorNames
   put the result into tChosen
   answer tChosen -- this just gives the line number selected, not the name!
   
   -- no success with these!
   #answer the clickText of tChosen
   #answer the selectedText of tChosen
   
   
end mouseup

Klaus
Posts: 13828
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: MobilePick: how to display the 'text' (not line number!)

Post by Klaus » Wed Oct 28, 2020 10:40 am

Hi Glenn,

well, that's the way MOBILEPICK works, if in doubt always consult the dictionary! 8)

Do this:

Code: Select all

...
put the colorNames into tColorNames
mobilePick tColorNames
put the result into tChosen
answer line tChosen of tColorNames
...
Best

Klaus

glenn9
Posts: 223
Joined: Wed Jan 15, 2020 10:45 pm
Location: Europe

Re: MobilePick: how to display the 'text' (not line number!)

Post by glenn9 » Wed Oct 28, 2020 10:46 am

Dear Klaus,

as ever, thank you so much for sharing this!

I've spent literally days trying to achieve by trial and error what you've elegantly solved so concisely!

Many thanks again,

Kind regards,

Glenn

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”