Page 1 of 1

This is Interesting

Posted: Wed May 22, 2013 10:05 am
by FireWorx
Can anyone figure out why in the attached stack this script grabs the phone number out of the third column of the data grid in the IDE but not in the simulator? The funny thing is it was working both in the simulator and on my phone devise making phone calls earlier.
Weird!
Dave

on mouseUp
put the dgHilitedLines of group "mygrid" into theLine
put the dgDataOfLine[theLine] of group "mygrid" into theDataA
put theDataA[column3] into tValue
answer "Would you like to call" && tValue && "?" with "Yes" or "Cancel"
if it is "Yes" then
replace "-" with "" in tValue
answer tValue
put "tel:" & tValue into tMYNumber
   launch url tMYNumber
end if
end mouseUp

Re: This is Interesting

Posted: Wed May 22, 2013 6:53 pm
by James Little
I don't think we can make a call using the simulator.

http://stackoverflow.com/questions/9679 ... ners-to-it

Re: This is Interesting

Posted: Thu May 23, 2013 6:07 am
by FireWorx
Yes I realize that. It's the script below that doesn't return the phone number in column number three that I can't figure out.
tvalue contains the phone number in the IDE but is empty in the simulator and on the devise and yes the var theLine does contain a valid line number.

put the dgDataOfLine[theLine] of group "mygrid" into theDataA
put theDataA[column3] into tValue

Dave

Re: This is Interesting

Posted: Fri May 24, 2013 11:57 am
by strongbow
Hi Dave

I believe it is because you don't have the datagrid template substack with your stack - I think this is necessary for it to function correctly... (I just inserted some "put" statements after some of your statements and that indicated your vars were empty).

Though that doesn't explain why it still seems to work in the dev environment (maybe thanks to some other stack loading the DG substack?).

HTH

Alan