files, names and files

Richard Gaskin ambassador at fourthworld.com
Fri Jun 24 16:30:59 EDT 2005


Timothy Miller wrote:
> Are there other good resources I'm overlooking?

First stop:
<http://support.runrev.com/scriptingconferences/>

Second:
<http://www.revjournal.com/links/index.html>

Third:
<http://dmoz.org/Computers/Programming/Languages/Transcript/>


> Would someone be so kind as to explain the technical and practical 
> distinctions between
> 
> --The Name of a stack
The name property lets you identify any object with a text string.


> --The Title of a stack
This governs what's displayed in the stack window's title bar; if empty 
it displays the name.


> --The name of the stack as it appears on the hard disk
This is simply the name of the stackfile that contains your mainstack 
and any substacks.  It is normally independent of the name of any stack 
it contains, but if you want to display the file name in the title bar 
you can use this:

   on preOpenStack
     set the itemdelimiter to "/"
     get last item of the effective filename of this stack
     set the title of this stack to it
     pass preOpenStack
   end preOpenStacl


> --The name of a stack specified in the stackfiles

Rev stacks can be referenced by their short name, providing Rev knows 
where they are.  Any stacks contained in the stack file your scripts are 
in can be found easily, but what about stack in other files?  That's 
where the stackFiles property comes in:

The stackFiles property identifies which files specific stacks can be 
found.  The property is a return-delimited list in which each line 
contains two elements separated by commas:

   <stackName>,<filename>

e.g.:

   MyAbout,/components/myAppResources.rev
   MySaveDialog,/components/myAppResources.rev

This tells Rev that anytime your scripts refer to "MyAbout" or 
"MySaveDialog" it can find those in the stackfile named 
"myAppResourcs.rev" in a folder named "components".  Note that the 
filename is relative to the filename of the stack whose stackFiles 
property you're setting, so it works much like HTML in allowing relative 
paths.  You can use a full path, but of course if you move your files to 
another machine the full path may not be the same.

Once you have a stack with the stackfiles set as shown, you can open 
those other stacks easily:

   modeless "MyAbout"
   modal "MySaveDialog"


-- 
  Richard Gaskin
  Fourth World Media Corporation
  ___________________________________________________________
  Ambassador at FourthWorld.com       http://www.FourthWorld.com


More information about the use-livecode mailing list