Standalone build workaround

panagiotis merakos merakosp at gmail.com
Wed Sep 19 03:45:11 EDT 2018


Hello Jacque,

The Standalone Builder closes and opens the stack when building a
standalone, so this means that all the messages that are sent when closing
and opening the stack will be sent. So yes, all the (pre)open*/close*
messages are expected to be sent.

The "if" block should change to:

 if the environment is "development" AND there is a stack
"revStandaloneProgress" AND the mode of stack
"revStandaloneProgress" > 0 then
     exit handlerName
   end if


as when you open the stack for the first time (without having built a
standalone before), the stack "revStandaloneProgress" is not loaded yet
(thus the "can't find stack error).

So you could write a function:

function isBuildingStandalone
   return the environment is "development" AND \
         there is a stack "revStandaloneProgress" AND \
            the mode of stack "revStandaloneProgress" > 0
end isBuildingStandalone

and then in e.g. the openstack handler:

on openstack
   if isBuildingStandalone() then
      exit openstack
   end if
   ..
   ..
end openstack

Similar in all other (pre)open*/close* messages.

Kind regards,
Panos
--

On Wed, Sep 19, 2018 at 9:31 AM J. Landman Gay via use-livecode <
use-livecode at lists.runrev.com> wrote:

> The standalone builder no longer locks messages; the docs say this:
>
> "As an attempt to improve this situation, the code that locks messages
> when closing and opening stacks for standalone builds has been removed.
> This means that where previously mainstacks would not receive openStack
> and closeStack messages during standalone build, they now do."
>
> First off, is this true only for openstack and closestack, or for all
> open*/close* messages, such as opencard, openbackground, etc.?
>
> Secondly, if the suggested workaround is placed into an openStack handler:
>
> on openstack
>    if the environment is "development" and the mode of stack
> "revStandaloneProgress" > 0 then
>      exit openStack
>    end if
> end openstack
>
> The IDE throws an error: can't find stack
>
> Suggestions? I'm trying to help someone debug this problem, as the stack
> has an openStack handler that needs to run. If the issue only applies to
> openStack messages, then we can change the handler to openCard instead.
> If the problem is for all open* messages then we need another solution.
>
> --
> Jacqueline Landman Gay         |     jacque at hyperactivesw.com
> HyperActive Software           |     http://www.hyperactivesw.com
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list