[Solved] - library stack works in dev but not in standalone

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Cairoo
Posts: 112
Joined: Wed Dec 05, 2012 5:54 pm

[Solved] - library stack works in dev but not in standalone

Post by Cairoo » Thu Jan 09, 2014 2:17 pm

Hi gurus,

I have created a shared library stack which I use by inserting it into the message path with "start using stack tFullPathToStack". This works flawlessly in the development environment, but in the standalone, the library stack's functions are unavailable while its message handlers are only available when triggered with the dispatch command. I can't seem to reproduce the problem in a new app. The problem exists only in this one app. Does anyone have an idea what might be causing this?

Thanks in advance

Cairoo
Last edited by Cairoo on Thu Jan 16, 2014 7:27 pm, edited 1 time in total.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10058
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: library stack works in dev but not in standalone

Post by FourthWorld » Thu Jan 09, 2014 4:27 pm

Is the path you're using to identify the stack valid from the standalone? If this is on a Mac, remember that the standalone is not the app's actual location, but instead the app is a few folders deeper inside the .app bundle.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Cairoo
Posts: 112
Joined: Wed Dec 05, 2012 5:54 pm

Re: library stack works in dev but not in standalone

Post by Cairoo » Thu Jan 09, 2014 4:34 pm

I can confirm that the path is indeed valid from the standalone, because the library stack's message handlers are triggered when a message is sent to it with the dispatch command. I just can't understand how the messages can make their way to the library stack but not the function calls.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10058
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: library stack works in dev but not in standalone

Post by FourthWorld » Thu Jan 09, 2014 4:47 pm

Can you please post some of the relevant code so we can so what's happening? Thanks.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Cairoo
Posts: 112
Joined: Wed Dec 05, 2012 5:54 pm

Re: library stack works in dev but not in standalone

Post by Cairoo » Thu Jan 09, 2014 5:10 pm

For the life of me I can't reproduce the problem in a new app. The app it's happening to is proprietary, so I'll try to create a dumbed-down copy of it and if the problem still exists in the dumbed-down copy, I'll post that.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10058
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: library stack works in dev but not in standalone

Post by FourthWorld » Thu Jan 09, 2014 5:13 pm

That's often a good diagnostic move anyway, making an example to isolate the problem. If it turns out to be a bug that can be submitted with the report to help the team, but most often making a good isolated example helps us just fix our own scripts. :)
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Cairoo
Posts: 112
Joined: Wed Dec 05, 2012 5:54 pm

Re: library stack works in dev but not in standalone

Post by Cairoo » Thu Jan 09, 2014 5:51 pm

Guys, I think it's caused by some code in the libray stack because when I move all the code from the library stack to the app's main stack, the same thing happens to the app's main stack. I'm one step closer...

Cairoo
Posts: 112
Joined: Wed Dec 05, 2012 5:54 pm

Re: library stack works in dev but not in standalone

Post by Cairoo » Thu Jan 16, 2014 7:27 pm

Hello again

I have fixed it! :D

The problem was caused by a single line of code that generates a UUID. The undocumented internal "generate_uuid" method used to work in previous versions of LiveCode, but since version 6.1 it no longer works, because the newly introduced "uuid" function must be used instead. My library stack was still using the internal "generate_uuid" method.

So all I had to do was to change

Code: Select all

_internal call "generate_uuid"
to

Code: Select all

get uuid()
and now all is well.

Thanks for bearing with me while I was recreating some stacks and restructuring some code.

Kind Regards,

Cairoo

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

Re: [Solved] - library stack works in dev but not in standal

Post by jacque » Fri Jan 17, 2014 10:14 pm

Any command that is undocumented and that starts with "_internal" is not to be trusted. Avoid! ;)
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply