Repairing the amnesia of standalones

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Re: Repairing the amnesia of standalones

Postby bogs » Sat Aug 26, 2017 8:03 pm

jacque wrote:
kresten wrote:So nice, but how can I test reliably on my own computer with its installed LC ?

Just build the standalone and run it. A standalone is an independent app that LC won't see. The way it works on your computer is how it will work on anyone's computer (on the same OS).

I thought about mentioning that, but kresten's statement makes me think they won't believe it if Lc is installed. A vm is a simple solution to that problem, as well as giving the ability to test multiple platforms without much difficulty.
Image
bogs
 
Posts: 388
Joined: Sat Feb 25, 2017 10:45 pm

Re: Repairing the amnesia of standalones

Postby kresten » Fri Sep 08, 2017 2:50 pm

Thank you for instructions, i followed the sugested scripting, and performed the standaloning of the launcher, placed in the same folder as the mainstack, but - alas - it doesn't open the mainstack. Can there be specifications of the standaloning setup necessary to make the launcher do its job ? I am working in LC v 6.7.8.
kresten
 
Posts: 88
Joined: Tue Sep 30, 2008 3:01 pm
Location: Copenhagen

Re: Repairing the amnesia of standalones

Postby FourthWorld » Fri Sep 08, 2017 3:25 pm

kresten wrote:Thank you for instructions, i followed the sugested scripting, and performed the standaloning of the launcher, placed in the same folder as the mainstack, but - alas - it doesn't open the mainstack. Can there be specifications of the standaloning setup necessary to make the launcher do its job ? I am working in LC v 6.7.8.

Standalones can open stack files just as the IDE does; they both use the same scripting language.

What does the code you're using for that look like?
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 5308
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles

Re: Repairing the amnesia of standalones

Postby kresten » Sat Sep 09, 2017 12:05 pm

I dont understand your question. Does it refer to the short script in the launcher stack ?
kresten
 
Posts: 88
Joined: Tue Sep 30, 2008 3:01 pm
Location: Copenhagen

Re: Repairing the amnesia of standalones

Postby FourthWorld » Sat Sep 09, 2017 4:18 pm

kresten wrote:I dont understand your question. Does it refer to the short script in the launcher stack ?

The code we'd need to see is the code that isn't working.

It seems the issue at hand is that the standalone isn't able to open a stack file. If that's correct, the code that determines the path to the stack file and then attempts to open it is what we'd need to see.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 5308
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles

Re: Repairing the amnesia of standalones

Postby kresten » Mon Sep 11, 2017 12:34 pm

Well, I have been trying this, but it doesn't open the stack, neither when placed into the Diaryproper folder nor in the folder above that.

on openStack
open stack "/Diaryproper/e-diary.livecode"
hide this stack
end openStack

:?:
kresten
 
Posts: 88
Joined: Tue Sep 30, 2008 3:01 pm
Location: Copenhagen

Re: Repairing the amnesia of standalones

Postby bogs » Mon Sep 11, 2017 1:28 pm

Is the launcher in the same folder as the stack it is launching? If it is, you could use relative path expression to open the stack, such as this -
Code: Select all
on openStack
open stack "e-diary.livecode"
hide this stack
end openStack

Try that first (putting the two in the same folder if they are not currently), and let us know how it works out. Others may have other suggestions as well.

Just as an example of how it should work, this is a simple demo of a timer with a launcher (it was an early prototype, so hold back on the laughter :D ) Only turn the launcher (clearly labeled) into the standalone and save it back to the demo folder.

bubbleLauncherDemo.zip
Simple demo of a launcher stack...
(8.33 KiB) Downloaded 9 times
Image
bogs
 
Posts: 388
Joined: Sat Feb 25, 2017 10:45 pm

Re: Repairing the amnesia of standalones

Postby kresten » Mon Sep 11, 2017 2:27 pm

I tried as you suggested, with no avail.
I observe, that the standalone Launcher doesn't close itself.
Could the mere size of my mainstack (2,2 Mb) be a problem ?
The size of the standalone Launcher becomes 4,7 Mb.
kresten
 
Posts: 88
Joined: Tue Sep 30, 2008 3:01 pm
Location: Copenhagen

Re: Repairing the amnesia of standalones

Postby bogs » Mon Sep 11, 2017 3:03 pm

The demo I uploaded failed to work? I think I'd have to ask at this point if you are developing on a mac, since I've thoroughly tested and had other people test this stack on windows and linux. The only thing I can think at this point is that your on a mac possibly, which has different rules for the app folder.
Image
bogs
 
Posts: 388
Joined: Sat Feb 25, 2017 10:45 pm

Re: Repairing the amnesia of standalones

Postby kresten » Mon Sep 11, 2017 3:15 pm

No Your demo works fine
kresten
 
Posts: 88
Joined: Tue Sep 30, 2008 3:01 pm
Location: Copenhagen

Re: Repairing the amnesia of standalones

Postby jacque » Mon Sep 11, 2017 3:27 pm

The size of the standalone isn't a problem, and it's actually a fairly small size as standalones go.

The most likely cause of the failure is a bad file path, which is why it would help for us to see the part of the script that tries to open the file.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 3798
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN

Re: Repairing the amnesia of standalones

Postby FourthWorld » Mon Sep 11, 2017 3:59 pm

kresten wrote:Well, I have been trying this, but it doesn't open the stack, neither when placed into the Diaryproper folder nor in the folder above that.

on openStack
open stack "/Diaryproper/e-diary.livecode"
hide this stack
end openStack

:?:

All file I/O is best accompanied by error-checking, given the range of things that can go wrong (paths, permissions, etc.). Try this and report back what you get - I suspect Jacque's right, that it's the path that needs adjusting:on openStack
Code: Select all
on openrStack
   open stack "/Diaryproper/e-diary.livecode"
   if the result is not empty rhen
        answer the result &&"(" & sysError() &")"
        exit to top
   end if
   hide this stack
end openStack

The result will contain a generic message from LiveCode if the file cannot be opened; sysError will return the OS error code specifying why that happened.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 5308
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles

Re: Repairing the amnesia of standalones

Postby jacque » Mon Sep 11, 2017 4:24 pm

For some reason I missed the reported handler, sorry. When a standalone launches, the defaultfolder is the folder containing the app (on a Mac, that's inside the app bundle.) The path in the handler points to a folder inside the the app's folder which probably isn't where the file is.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 3798
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN

Re: Repairing the amnesia of standalones

Postby kresten » Tue Sep 12, 2017 11:51 am

I followed Richards scripting and got the answer : No such card(2)
I am afraid I dont understand Jaques advice and its reference to app and bundle. My mainstack and its folders are placed on my desktop. will I have to go elsewhere ?
kresten
 
Posts: 88
Joined: Tue Sep 30, 2008 3:01 pm
Location: Copenhagen

Re: Repairing the amnesia of standalones

Postby bogs » Tue Sep 12, 2017 12:13 pm

kresten, first we really need to know what Operating system your working with, paths vary from os to os. From the reported error (No such card(2)), it sounds like the program is unable to find the stack your telling it to launch or you have code in the program referring to a card that doesn't exist, which is causing it to fail.

You said my demo program worked fine, so this technique *does* work, at this point it is just a matter of tracking down where your version is amiss.

Feel free to zip up your stacks and post them, which is the easiest way to track down the issue.
Image
bogs
 
Posts: 388
Joined: Sat Feb 25, 2017 10:45 pm

PreviousNext

Return to Talking LiveCode

Who is online

Users browsing this forum: No registered users and 3 guests

cron