problem with "launch" in a standalone
Peter M. Brigham
pmbrig at gmail.com
Tue Nov 26 20:38:59 CET 2013
I used answer commands to locate the problem. Repeatedly if I have a general function handler in the main stack script, even something simple like:
function lastThing str, delmtr
set the itemdel to delmtr
return item -1 of str
then any script that calls the function will fail silently. If I move the contents of the function script into the calling script and do the exact same things directly instead of using a function, it works fine in the standalone. So I sacrificed elegance and brevity and stopped calling any of my utility functions and moved the contents into the various calling handlers. Don't know why I would have to do this, but problem solved. It didn't have to do with the launch command, it was failing right before the launch line of the script.
I now have (1) a working standalone and (2) more puzzlement about the workings of LiveCode.
Peter M. Brigham
pmbrig at gmail.com
On Nov 25, 2013, at 11:10 PM, Phil Davis wrote:
> Oops. it's a standalone. Try 'answer tFilePath' or some other display method instead of using the breakpoint.
> On 11/25/13, 8:08 PM, Phil Davis wrote:
>> Hi Peter,
>> Have you tried putting a breakpoint at your "launch" line so you can see what's in the tFilePath variable? It may not contain what you think. At least that's how it sometimes works for me.
>> Phil Davis
>> On 11/25/13, 7:10 PM, Peter M. Brigham wrote:
>>> So I have a handler that runs fine in the IDE, and even when I suspend the development tools it runs fine, but when I build the standalone it fails. The idea is to be able to store the locations of images and display them in the default image app when they are chosen from a pop-up list. In the standalone, when I select the name of the image from the pop-up, nothing happens.
>>> The script of my pop-up button includes the following (see the bottom section for where the problem lies):
>>> on menuPick u
>>> -- each card has a property storedImages
>>> -- which is an array of one or more images and info
>>> -- if <uTitle> is the title of the image, then
>>> -- each storedImages[<uTitle>] is an array:
>>> -- storedImages[<uTitle>]["uImage"] is an image
>>> -- storedImages[<uTitle>]["uFilepath"] is the location of the image file
>>> -- storedImages[<tTitle>]["uExtension"] is the file extension (file type) -- jpg, png, pdf, etc.
>>> put the shiftkey is down into deleting
>>> case u contains "store"
>>> answer file "Choose your image:"
>>> if it = empty then exit to top
>>> put it into tPath
>>> importImage tPath
>>> -- an image title was selected
>>> put the storedImages of this card into rImages
>>> if deleting then
>>> … <snip> ..
>>> else -- display image
>>> ******** this is the part that isn't working: ********
>>> put rImages[u]["uImage"] into tImage
>>> put rImages[u]["uFilepath"] into tFilepath
>>> put lastThing(tFilepath,"/") into shortFileName
>>> if there is a file (tFilepath) then
>>> launch document tFilepath
>>> if the result <> empty then
>>> answer the result as sheet
>>> end if
>>> The fact that I don't get an error answer dialog means that the launch command is not returning any indication of a problem. Any suggestions? 2008 MacBook, OSX 10.7.4 (Lion), Rev Studio 5.5.1, build 1487. Yes, I'm still running an older version of LC.
>>> -- Peter
>>> Peter M. Brigham
>>> pmbrig at gmail.com
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> Phil Davis
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the use-livecode