mobilePick

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Jason1234
Posts: 42
Joined: Sat Jun 18, 2011 9:20 am

mobilePick

Post by Jason1234 » Wed Apr 04, 2012 9:07 am

I have a list of items to choose in the mobilePick OFF,ON,FLASHING,1 FLASH......

The result of the selected item is the index value of the item selected 1,2,3,4....

Can the text of the selected item be used... label or something?

I could do this in code depnding on the item selected but I have a few of these to do so I would prefer to be able just to use the text of the selected item not it's index value.

Currently I am having to do this

Code: Select all

   mobilePick "OFF" & return & "ON" & return & "FLASHING" & return & "1 FLASH" & return & "2 FLASHES"
    switch the result
         case "1"
         Put "OFF"  into  toperation
         break
         case "2"
         Put "ON" into toperation
         break
         case "3"
         put "FLASHING" into toperation
         break
         case "4"
         put "1 FLASH" into toperation
         break
         case "5"
         put "2 FLASHES" into toperation
          break
end switch
       set the label of btn "operation" to toperation
Can anyone help point me in the right direction?
Windows / MAC / IOS / Android - Deployment
Build 5.5.4 / & Community Version 6.1

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7258
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: mobilePick

Post by jacque » Wed Apr 04, 2012 5:17 pm

Put the list into a variable before you send it to the mobilepick command. When the index value is returned, just "get line <index>" of the variable. I.e.:

Code: Select all

put "OFF" & return & "ON" & return & "FLASHING" & return & "1 FLASH" & return & "2 FLASHES" into tList
mobilePick tList
put the result into tIndex
put line tIndex of tList into tText
switch tText
 case "on"
  ... etc
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Jason1234
Posts: 42
Joined: Sat Jun 18, 2011 9:20 am

Re: mobilePick

Post by Jason1234 » Thu Apr 05, 2012 2:41 am

Thank you again, you are always so willing to help...and usually one of the first too.

I ended up needing to have different mobilePick options list so the variable option would not save that much in coding.

I got it working, perhaps not that refined but it works.

Thank you again for your suggestion.
Windows / MAC / IOS / Android - Deployment
Build 5.5.4 / & Community Version 6.1

Post Reply

Return to “Android Deployment”