At 5:13 AM +0900 17/12/1999, Nicolas R Cueto wrote:

>Likewise unforeseen, the standalone's files become unopenable if they're
>stored in sub-folders within instead of alongside the standalone's
>folder.
>
>If, as I imagine, the solution is to script an explicit directory path,
>any suggestions about how to do this when the directory letter (C:/,
>D:/, etc:/)for the HD, FDD, etc., is unknowable beforehand?

Hi Nicolas

One strategy is to store all the paths to key locations in a global 
at start up. I use an array called gxxxPaths with keys such as 
gxxxPaths["records'], gxxxPaths["audio"], etc. (xxx is a label for 
each project, to avoid mixups when multiple projects are open)

The following function will return the directory of a stack (send the 
short name of the stack as a parameter.)

function stackDirectory pStack
   put the itemDel into tSavedDel
   set the itemDel to "/"
   put the effective filename of stack  pStack into tPath
   delete item -1 of tPath
   set the itemDel to tSavedDel
   return tPath
end stackDirectory

If the various sub-folders are all in a fixed position relative to 
the standalone, you can use the function to get the directory of the 
standalone at start up and then build the other paths from that. The 
advantage of this function over "the directory" property is that the 
function will work in both development and standalone, and you don't 
need to worry that you might have inadvertently changed the current 
directory.

Cheers
Dave Cragg

This is the MetaCard mailing list.
Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm

Reply via email to