This is Interesting

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
FireWorx
Posts: 362
Joined: Wed Sep 07, 2011 9:39 pm

This is Interesting

Post by FireWorx » Wed May 22, 2013 10:05 am

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
Attachments
MyPhoneTest.livecode.zip
(4.86 KiB) Downloaded 251 times

James Little
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 47
Joined: Thu Apr 27, 2006 11:19 pm

Re: This is Interesting

Post by James Little » Wed May 22, 2013 6:53 pm

I don't think we can make a call using the simulator.

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

FireWorx
Posts: 362
Joined: Wed Sep 07, 2011 9:39 pm

Re: This is Interesting

Post by FireWorx » Thu May 23, 2013 6:07 am

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

strongbow
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 146
Joined: Mon Jul 31, 2006 1:39 am
Contact:

Re: This is Interesting

Post by strongbow » Fri May 24, 2013 11:57 am

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

Post Reply