Page 1 of 1

iphonePick Question

Posted: Tue Jun 12, 2012 8:11 am
by Nakia
Hi,

I have the below code which is taking the contents of a file, placing it in a variable then using that to populate a button.
when the selection is pressed that is then placed into the label of the button.

Problem is, when ever any line that ends in 0 is pressed IE 10,20,30 it is exiting the handler because of the 0 behind the leading number.
I have tried adding in the wholematches command but the error still occurs.

any ideas?

Code: Select all

 if the environment is not mobile then exit mouseDown
      put specialfolderpath(documents) & "/pilots.dat" into thePath
      put url ("file:"& thePath) into tList
      iphonePick (tList)
         put the result into tResult
      set the wholematches to true
      if tResult contains "0" then exit mouseDown
   if tResult is not empty then 
      put "ID=" & word 3 of line tResult of tList into line 1 of fld "ScoreRunS1"
      set the label of btn "PilotID" to line tResult of tList
      set the filename of image "PilotImage" to specialfolderpath("documents") & "/" &  word 3 of line tResult of tList  & ".png"
      end if

Re: iphonePick Question

Posted: Tue Jun 12, 2012 9:26 am
by Klaus
Hi Nakia,
if tResult contains "0" then exit mouseDown
well, what did you exspect with this line? :shock:

Maybe this is better:
...
if tResult = empty then exit mouseDown
...

Best

Klaus

Re: iphonePick Question

Posted: Tue Jun 12, 2012 9:45 am
by bn
Hi Nakia,

try

Code: Select all

if tResult = 0 then exit mouseDown
to catch "cancel" of the popUp

"contains" means among other things.

kind regards
Bernd

Re: iphonePick Question

Posted: Tue Jun 12, 2012 9:57 am
by Nakia
Klaus wrote:Hi Nakia,
if tResult contains "0" then exit mouseDown
well, what did you exspect with this line? :shock:

Maybe this is better:
...
if tResult = empty then exit mouseDown
...

Best

Klaus
If I had the answer I wouldn't have posted the question :evil:
I am not an expert like you Klaus..

Thanks Bernd for your help..

Re: iphonePick Question

Posted: Tue Jun 12, 2012 10:21 am
by Klaus
There is an entry about "contains" in the dictionary, but OK, I got the message!