After mobilePick, script may or may not continue.

J. Landman Gay jacque at hyperactivesw.com
Mon Oct 14 14:15:11 EDT 2013


On 10/14/13 1:05 PM, Roger Eller wrote:
> I am still having a problem with getting subsequent mobilePick to work.  I
> tried moving my cases into a separate handler or function.  If the script
> is in a separate hidden button, I can make it work, but I don't want the
> extra button(s).
>
> *Goal:*  Present a pick list, followed by another pick list based on the
> context of the first.
>
> Any ideas?

Wild guess: maybe it's a timing problem. You could try moving the actual 
picklist commands into a separate function (as you did) and then calling 
it from another handler. But when the first picklist returns a value, 
the calling handler would issue a "send getPicklist to me in 10 ticks" 
command to display the second list.

Maybe it needs some recovery time. Who knows.

>
> On Sun, Oct 13, 2013 at 8:21 PM, Roger Eller wrote:
>
>> The script below always fires the first pick list.  What seems strange to
>> me is that after making this choice, the next pick list may or may not ever
>> happen.  Why?  Is is a bug, or should I be doing something differently
>> here?  Thanks in advance.
>>
>> on touchEnd pid
>>     put "PRIMARY" & cr \
>>           & "SECONDARY" & cr \
>>           & "THIRD" & cr into tList0
>>     put lineoffset("SECONDARY", tList0) into tInitialIndex0
>>     mobilePick tList0, tInitialIndex0
>>
>>     put the result into tChoice1 -- returns 1, 2 or 3
>>
>>     switch tChoice1
>>     case 1
>>     put "X1" & cr \
>>           & "X2" & cr \
>>           & "X3" & cr \
>>           & "X4" & cr into tList1
>>     put lineoffset("X2", tList1) into tInitialIndex1
>>     mobilePick tList1, tInitialIndex1
>>     break
>>
>>     case 2
>>     put "Y1" & cr \
>>           & "Y2" & cr \
>>           & "Y3" & cr \
>>           & "Y4" & cr into tList2
>>     put lineoffset("Y2", tList2) into tInitialIndex2
>>     mobilePick tList2, tInitialIndex2
>>     break
>>
>>     case 3
>>     put "Z1" & cr \
>>           & "Z2" & cr \
>>           & "Z3" & cr \
>>           & "Z4" & cr into tList3
>>     put lineoffset("Z2", tList4) into tInitialIndex3
>>     mobilePick tList3, tInitialIndex3
>>     break
>>     end switch
>>     put the result into tChoice2 -- returns 1, 2, 3 or 4
>>
>>     answer tChoice1 && tChoice2
>> end touchEnd
>>
>> ~Roger
>>
>>
>>
>>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com




More information about the use-livecode mailing list