Page 1 of 2

New Card in Standalone Application

Posted: Sat Feb 04, 2017 6:35 am
by Xacto
I have a stack with grouped buttons that have the following codes:

Code: Select all

new card
and

Code: Select all

delete this card
.

When I save it as a standalone it will no longer save the newly created cards when I close the application.

Is there a way to make this work like it does in the livecode editor?

Re: New Card in Standalone Application

Posted: Sat Feb 04, 2017 1:02 pm
by jmburnod
Hi Xacto,
A standalone remains as it compiled.
I know two ways to do what you want
1. Export what is changed to external files and import them at preopenstack
2. Use stacks which can be modify. Your standalone can be invisible and the user works with a stack opened by standalone.
Best regards
Jean-Marc

Re: New Card in Standalone Application

Posted: Sun Feb 05, 2017 5:43 am
by dunbarx
Hi.

What jean-Marc said.

What he means is that all standalone are prohibited from being modified by any OS. My suggestion is his #2. You create a "splash" stack, which is its own stack file, the actual executable, and need not have any functionality at all. It merely is a vehicle for any number of additional stack files, completely independent, which are added to the executable stack file in the standalone settings. These others can all be changed and saved.

There are numerous threads on this subject going back years. Search for "splash". But most important, make a simple example that you might craft in just a few minutes, and experiment. Then when you have the concept down, apply it to your project.

Craig Newman

Re: New Card in Standalone Application

Posted: Mon Feb 06, 2017 2:38 am
by Xacto
Thank you all... I will have to experiment with creating a splash.

Re: New Card in Standalone Application

Posted: Mon Feb 06, 2017 9:05 am
by AndyP
Have a look here...similar question,

http://forums.livecode.com/viewtopic.php?f=8&t=28788

Re: New Card in Standalone Application

Posted: Tue Feb 07, 2017 2:35 am
by Xacto
Have a look here...similar question,
http://forums.livecode.com/viewtopic.php?f=8&t=28788
So, I created a "splash" stack like explained in the forum. However, when i create the standalone it does not seem to find the program it needs to launch. I placed application and all the other files in the same folder.

I have included the simple test example.

Any idea why it does not work?

Thanks,
Brian

Re: New Card in Standalone Application

Posted: Tue Feb 07, 2017 3:52 am
by dunbarx
Is it that you cannot save the "working" stack or that you cannot launch the executable at all? Should not be an issue with the second.

Craig

Re: New Card in Standalone Application

Posted: Tue Feb 07, 2017 4:02 am
by Xacto
The program does not launch.

I think I may have figured it out. Please correct me if I am wrong.

I need to do the following:
Go to this location: File > Standalone Application Settings > Stacks.
Check "Move substacks into individual stackfiles".
Select "Add Stack File..." button and chose the stack you want to launch.

Once I do this, it seems to work after I compile it. It also seems to work without including the .livecode files in the same folder.

Is this the correct way?

Thanks!

Re: New Card in Standalone Application

Posted: Tue Feb 07, 2017 8:28 am
by AndyP
I just tried your zip example and all works as expected.

A bit of clarification on how to construct this.

The Launcher.livecode and HyperTest.livecode stacks should be created independently from each other.
The HyperTest.livecode is not a substack of Launcher.livecode it is its own top level stack.

None of this is required.
Go to this location: File > Standalone Application Settings > Stacks.
Check "Move substacks into individual stackfiles".
Select "Add Stack File..." button and chose the stack you want to launch.
Also the HyperTest.livecode should not be compiled.. it remains a livecode stack not an exe

Re: New Card in Standalone Application

Posted: Tue Feb 07, 2017 3:36 pm
by dunbarx
Also the HyperTest.livecode should not be compiled.. it remains a livecode stack not an exe
I assume this means "..should not be made into a standalone".

All stacks need to be compiled and saved.

Craig

Re: New Card in Standalone Application

Posted: Tue Feb 07, 2017 5:36 pm
by AndyP
Hi Graig,

yep...correct...one day ill get away from Delphi terminology :oops:

Re: New Card in Standalone Application

Posted: Thu Feb 09, 2017 4:23 am
by Xacto
None of this is required.

Go to this location: File > Standalone Application Settings > Stacks.
Check "Move substacks into individual stackfiles".
Select "Add Stack File..." button and chose the stack you want to launch.
Sorry for all these questions - I appreciate all the help. Just trying to get my head around this. :)

So, If i do not do all the things I described above (which you say is not required) - it fails to launch on my end. I created a standalone for just the launcher and when run it and I hit the button, it just sits there. It is odd that you can run my original uploaded stack with no problem. I am running on a MAC, are you on a PC? Would this make a difference?

Another thing... I am providing a link to the standalone application that I using the "Add Stack File..." (added HypeTest.livecode) when I compiled the launcher. If you run it, you will see it works even without the HyperTest.livecode file in the same folder. It no longer needs two files; launcher and HypeTest.livecode. Just the Launcher.

Is this correct or am I missing something?

https://www.dropbox.com/s/7jy6l8umtpzpe ... r.zip?dl=0

Thanks!

Re: New Card in Standalone Application

Posted: Thu Feb 09, 2017 6:47 pm
by jmburnod
Hi xacto,
I played a bit with your launcher stack.
you will see it works even without the "HyperTest.livecode" file in the same folder
Yes. If i understand you correctly, you added a stack "HyperTest.livecode" to the list of stacks in standalone setting.
You said "it works". I think you can't save what has been changed in "HyperTest.livecode" stack because
a standalone can't be modify


Fortunately, LiveCode is very flexible and you can open a stack and modify it if it is outside of standalone.
Unfortunately, the path of a stack is different if this stack is inside or outside of standalone (standalone is a package).

Here is your first stack with some changes
1. Stack script
getMyStackFolderPath() is a function that return the path of the folder where is your stack or standalone.
2. Btn "Launch" script
Changed for using getMyStackFolderPath

I didn't test save command, but i was surprised to see an answer dialog for change without changes.

Best regards
Jean-Marc

Re: New Card in Standalone Application

Posted: Fri Feb 10, 2017 3:36 am
by Xacto
Hmmm... That is what I thought, however.... I CAN save in my Launcher standalone without the .livecode file in the same folder? I can create new card and it will save it when I close and reopen it.

If I run your files that you just uploaded... After I create the standalone, it will only work if the HyperTest.llivecode is in the same folder. If you run the one ONE standalone file that I created, it works without any .livecode file in the folder.

I also compressed my folder with the Hypertest.livecode to make sure it is not linking to it.

Here is a video showing that it is working as a standalone, note there are no other files in the folder:
https://www.dropbox.com/s/m17vj69c3inu3 ... g.mov?dl=0

I am lost on why this is working for me. :)

Re: New Card in Standalone Application

Posted: Fri Feb 10, 2017 5:46 pm
by jmburnod
Hi Xacto,
I can create new card and it will save it when I close and reopen it.
Yes, i tested it and I was surprised that it works :shock: