Library Stacks PART II

J. Landman Gay jacque at hyperactivesw.com
Mon Mar 1 00:46:21 EST 2004


On 2/29/04 9:26 PM, Kevin wrote:

> on package thePackage
>   
>   local myContext, myLine, myDirectory, myShortPackage
>   
>   put thePackage into myShortPackage 
>   
>   get matchText( thePackage, ".+/(.*)", myShortPackage)
>   
>   replace quote with empty in myShortPackage 
> 
>   if myShortPackage is among the lines of the stacksInUse then return 
>   
>   put currentContext() into myContext 
>   
>   put line -2 of myContext into myContext 
>   put item -3 of myContext into myContext
>   
>   put the last word of myContext into myContext
>   
>   replace quote with empty in myContext
>   
>   get matchText( myContext, "(.*\/)", myDirectory )
>    
>   set the directory to myDirectory 
>   
>   start using thePackage
>   
> end package

I got curious about this handler. I may not understand what you are 
doing correctly since some of the functions are missing, but it looks 
like you are passing a full file path, parsing it down to the short 
name, changing the directory, and then putting the stack in use. Is that it?

If so, did you know you can put a stack in use by referring to it by its 
full path? That is, this works:

start using stack "Volume/Folder/Subfolder/mystack.rev"

No parsing required, and this way doesn't change the directory. On the 
other hand, maybe I misunderstood what you are doing.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com


More information about the use-livecode mailing list