Scope Problem on Standalones

Dave Cragg dcragg at lacscentre.co.uk
Mon Nov 28 10:50:58 EST 2005


On 28 Nov 2005, at 12:51, David Burgun wrote:
>
> Bu according to the documentation, the path returned should be the  
> path to the real application, e.g.
>
> MacOSX/myApp.app/Contents/MacOS/Runtime/Stacks/StackA.rev
>
> Or perhaps:
>
> MacOSX/myApp.app/Contents/MacOS/MyApp (real applicaiton)
>
> Have I got this wrong? I would be really grateful if someone could  
> just let me know if:

I don't think you've got it wrong.

As a quick test, I made two stacks "path_tester" and "stackA"

In the card script of "path_tester" I put this script:

on preopenstack
   put empty into field "pathlist"
   put the filename of this stack into tPath
   put tPath into field "pathlist"
   set the itemDel to "/"
   put item 1 to -2 of tPath into tDir
   if there is a stack (tDir & "/" & "stackA.rev") then

     toplevel (tDir & "/" & "stackA.rev")
   end if
end preopenstack

I built this into a standalone.

In the card script of stackA, I put this script:

on preopenstack
   if there is a stack "path_tester" then
   put cr & the filename of this stack after field "pathlist" of  
stack "path_tester"
   end if
end preopenstack

I then placed stackA.rev in the Contents/MacOS folder inside the  
standalone.

On running the standalone, I get the following in field "pathlist".

/Users/dave/Documents/RunRevStuff/problem testers/pathtest/ 
path_tester/path_tester.app/Contents/MacOS/path_tester
/Users/dave/Documents/RunRevStuff/problem testers/pathtest/ 
path_tester/path_tester.app/Contents/MacOS/stackA.rev

This is with Rev 2.6.1 on OS X 10.4.3 (but I'm pretty sure it also  
worked this way in earlier versions).

Can you show us the script that is producing the strange result?

Cheers
Dave




More information about the Use-livecode mailing list