No Such Card - Error

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
dave_probertGA6e24
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 328
Joined: Mon Dec 05, 2011 5:34 pm
Contact:

No Such Card - Error

Post by dave_probertGA6e24 » Sat Dec 21, 2013 8:15 am

Hi All,

I'm developing a simple (supposedly!) tool to load stacks from dropbox and run them on the iPad (personal app - not commercial).

I had a couple of self-induced problems solved elsewhere, but now I face one that has me lost.

I have used code like this to copy the livecode file from dropbox to a locally created folder (on the ipad):

Code: Select all

local lFilename
put "foobar" into lFilename
put "https://dl.dropboxusercontent.com/u/999999/"&lFilename&".livecode" into exURL
load URL exURL with message loadCompleted

on loadCompleted
   put URL exURL into URL ("binfile:"&specialFolderPath("documents") & slash & lFilename )
end loadCompleted
At a later date I can run the local copy of the file by clicking on a button:

Code: Select all

   go URL ("binfile:" & specialFolderPath("documents") & slash & lFilename )
   if the result is not empty then
      put the result into msg
   end if
That is the basic essence of the code - the exact code has more variables in place of the hard-coded example.

The problem is: This works fine in the IDE, works perfectly in the iPad Simulator, but gives an undocumented error "no such card" in 'the result' when trying it on the actual iPad.

I have tried variations of the 'go' command - 'go stack URL ()', go stack URL with no "binfile:" and other combinations - all produce the error on the device (some also do it in the simulator)

The file is there as I don't try to run the file without a check first.

The questions are:
To copy a livecode file from a remote 'secure' URL 'https://' to a local file via the above 'loadCompleted' method - is that correct? or is there a better way?
Is there some explanation for the 'no such card' error message I get in the result?

Thanks for any help,
Dave
Coding in the Sun - So much Fun.
Visit http://electronic-apps.info for released App information.

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: No Such Card - Error

Post by Dixie » Sat Dec 21, 2013 8:30 am

Dave..

If you mail me at john[at]ihouse.on-rev.com. I have a stack that does what you wish. It would not get through the 'apple review', but since it seems that you are not putting it up for review I think it might work for you..:-)

Dixie

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7389
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: No Such Card - Error

Post by jacque » Sat Dec 21, 2013 5:09 pm

The "no such card" error is one of the error dialog strings. See errorDialog in the dictionary for an explanation of how to see all of them. In this case, of course, it really means "no such stack".

Is the file in the Public folder in Dropbox? I haven't had much luck loading files from any other folders. Dropbox discontinued the old-style public folder last year so if you have a newer account you may not have one of those. You can try setting up another folder as sharable to all and see if that works. I'm still trying to figure out the best solution for Dropbox accounts without a public folder.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

dave_probertGA6e24
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 328
Joined: Mon Dec 05, 2011 5:34 pm
Contact:

Re: No Such Card - Error

Post by dave_probertGA6e24 » Sat Dec 21, 2013 9:18 pm

Hi Jaque

The file is indeed in the public folder and it definitely downloads Ok from there :) I have another app which does a 'go url "https://dl.drop..../spoon.livecode" ' and the stack does run Ok. So I know it works - in theory and practice.

The problem comes from the difference between the actual iPad and the Simulator execution. Simulator and IDE both download the file correctly and run it. The iPad says it has downloaded the file (it shows me the local filename and so forth), but will not run it from the local copy on the device.

Update: As I was writing this note Dixie sent me a stack that does similar to what I want - looking at the code showed me that it might be that I use a 'go stack URL localFile' type syntax, whereas I don't need the URL keyword in there.

Testing that now...

Strange that the IDE and Simulator are happy with the URL keyword though!

Update 2: Seems that is almost the problem ;) The next problem is that some files will copy Ok onto the iPad. but others come across as zero-byte sizes!!! They are fine in the Simulator though!
It's a never ending fight!

I'll keep this thread posted of my findings.

Cheers,
Dave
Coding in the Sun - So much Fun.
Visit http://electronic-apps.info for released App information.

Post Reply