Target not working???

David Burgun dburgun at dsl.pipex.com
Mon Mar 27 06:53:18 EST 2006


On 27 Mar 2006, at 11:43, Mark Smith wrote:

> The target of the 'start using' <is> stack TestLib, no?

I'm not sure and a bit confused! But from just experimenting with  
Target a bit more, yes, you are right.
Yes, that seems like another way to do it.

I would like to scan the script(s) of the stack that just did the  
"start using" and was hoping that I could do it without an additional  
call to the library, since it's a bit error prone and it's better  
practice anyway to do it in the "libraryStack" hanlder.

I could also use a Global and clear it after use, as in:

global gISMStackName

on libraryStack
   if gISMStackName = empty then
	 stop using "/Users/Dave/Desktop/TestLib/Lib.rev"
	 throw " gISMStackName not set"
      exit libraryStack	
   end if

   put "libraryStack" & cr after field 1 of me
   put gISMStackName after field 1 of me
   put cr & cr after field 1 of me
   select after field 1 of me

   put empty into gISMStackName
end libraryStack

Then in the stack that does the "start using" do this:

global gISMStackName
	
on mouseUp
   local myError

   put the long name of this stack into gISMStackName
  -- put empty into gISMStackName            --Uncomment to test the  
"try"

   try
     start using "/Users/Dave/Desktop/TestLib/Lib.rev"

   catch myError
     answer myError
   end try
end mouseUp


I'd have to do something similar in the releaseStack handler too.

Not sure what the best way to do this is? What do you think?

All the Best
Dave







More information about the use-livecode mailing list