Building a standalone - problem 1

Ken Ray kray at sonsothunder.com
Tue Mar 23 11:11:59 EST 2004


Jim,

Here's one of my most-used functions that returns the folder of the
currently running stack (so you can place other stacks in the same folder
and use the results of this function to find other stacks:

function MyFolder
  put the filename of this stack into tPath
  set the itemDel to "/"
  if (the platform = "MacOS") and isOSX() and (the environment <>
"development") then
    delete item -4 to -1 of tPath
    return tPath & "/"
  else
    return item 1 to -2 of tPath & "/"
  end if
end MyFolder

function isOSX
  set the itemDel to "."
  return (item 1 of the systemVersion >=10)
end isOSX

Richard Gaskin's also got one which uses the same isOSX function, called
"AppPath":

function AppPath
  put the filename of this stack into tPath
  set the itemdel to "/"
  If (isOSX()) then
    get offset(".app/Contents/MacOS/", tPath)
    if it > 0 then -- 2.4.3 or later
      delete char it to len(tPath) of tPath
    end if
  end if
  delete last item of tPath
  return tPath &"/"
end AppPath 

Either way, it works to get the folder where the stack that runs it is
currently sitting in, so you could say:

  open stack (MyFolder() & "MyStack.rev")

HTH,

Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/



> -----Original Message-----
> From: use-revolution-bounces at lists.runrev.com 
> [mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of 
> jcwall at jaguar1.usouthal.edu
> Sent: Tuesday, March 23, 2004 4:59 AM
> To: use-revolution at lists.runrev.com
> Subject: Building a standalone - problem 1
> 
> 
> I wonder if somebody could help me with building a standalone, a 
> task which is new to me.
> 
> Here is what I am doing.  I have built two main stacks; 
> "SLDataCollection" which I use to collect and store data and 
> "SLResults" which is essentially a single card where I place the 
> results for printing.  Everything works as planned on my mac 
> (PowerBook G4, 10.3.3).
> 
> Now I would like to build a standalone.  Since I will be collecting 
> and storing data the  "SLDataCollection" stack cannot be a 
> standalone, therefore, following the docs and much advice from 
> this list, I have mad a single card stack which will act as a splash 
> screen.  This stack has a small animation and includes the 
> following script:
> 
> on openstack
>   set the loc of me to the screenLoc
>   start using stack "SLDataCollection"
>   start using stack "StepLengthresults"
>  
> animation stuff here - hides and shows fields
> 
>   lock screen
>   go stack "SLDataCollection" in window "StepLength"
>   unlock screen with visual barn door open
> end openstack
> 
> I have put the two original main stacks in a folder "SLStuff" 
> which is 
> within a folder that contains the splash screen.
> 
> The first problem I am having is that this splash screen hangs up 
> because it cannot locate the stacks in the start using commands.  If 
> I open these stacks and close them again the splash screen works 
> fine.  In reading the docs I think that I have to provide a 
> filePath to 
> these files in the "SLStuff" folder.  I have spent a frustrating few 
> hours trying to get this done without success.  Any help would be 
> greatly appreciated - and I haven't even built the standalone yet!
> 
> Jim Wall
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com 
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 




More information about the use-livecode mailing list