Scope Problem on Standalones
sarah.reichelt at gmail.com
Sat Nov 26 06:31:48 EST 2005
> > I have an application that is comprised on a number of stacks.
> The top level stack is built into a Standalone and it calls other
> stacks (.rev files) via "start using" and "go stack" commands.
> When in the IDE the folder stucture is like this:
> BaseFolder/StartUp.rev <-- just contains a splash screen
> StartUp.rev figures out the correct path (by using the filename of
> this stack property) and does a goto StackA.rev.
> StackA in turn does a go to StackB.rev. This all works fine under the IDE.
> When runnig as a standalone the folder structure is like this:
> MacOSX/myApp.app <-- bundle
> MacOSX/myApp.app/Contents/MacOS/MyApp (real applicaiton)
I can't see why your soution doesn't work, but here is what I do in
In the preOpenStack handler on card 1 of stack "StackA":
put applicationFolder(the short name of this stack) into tFolder
set the defaultfolder to tFolder
start using stack "StackA"
function applicationFolder pStack
if pStack is empty then put the short name of this stack into pStack
put the effective filename of stack pStack into tFull
put empty into tFolder
set the itemdel to "/"
repeat for each item i in tFull
if i contains ".app" or i contains ".rev" then exit repeat
put i & "/" after tFolder
This function is stripped down to work only with OS X. If you want a
cross-platform equivalent, let me know.
More information about the Use-livecode