Am I overseeing something here?

Eric Chatonet eric.chatonet at sosmartsoftware.com
Tue Feb 20 14:30:19 EST 2007


Dear Klaus,

I have no answer (your code sounds good) but I always use the  
following code (in stack's scripts only of course):

on closestack
   if the long name of me = the long name of this stack then
     <statements> -- will be applied to 'this' stack only
   end if
end closestack

or:

on closestack
   switch the short name of this stack
   case "Klaus"
     <Have a good beer>
   break
  case "Eric"
     <Have a glass of wine>
   break
   default
     <Have a cup of tea>
   end switch
end closestack

;-)

Best Regards from Paris,
Eric Chatonet

Le 20 févr. 07 à 19:51, Klaus Major a écrit :

> Hi friends,
>
> I have a stack "XYZ" that I start using.
>
> Then I wrote a "closestack" handler and surely do not want to let  
> ALL stacks execute it.
> So I wrote an "if... then..." clause to filter other stacks.
>
> But only solution 1 does work, solution 2 does NOT?
>
> To me the logic is identically, but maybe I am overseeing something  
> obvious here?
> Any hints and explanations are very appreciated!
>
>
> Solution 1 does work:
> on closestack
>   if char -4 to -1 of the long name of the target = "XYZ" then
>     do this and that ONLY for stack XYZ
>  ...
>   end if
> end closestack
>
>
> Solution 2, does NOT work, "do this and that..." IS being executed  
> by other stacks:
> on closestack
>   if NOT char -4 to -1 of the long name of the target = "XYZ" then
>      exit closestack
>   end if
>   do this and that ONLY for stack XYZ
>   ...
> end closestack
>
>
> What do I miss here???
>
>
> Regards
>
> Klaus Major
> klaus at major-k.de
> http://www.major-k.de

------------------------------------------------------------------------ 
----------------------
http://www.sosmartsoftware.com/    eric.chatonet at sosmartsoftware.com/





More information about the use-livecode mailing list