Caching?

Tariel Gogoberidze tariel at mac.com
Fri Jul 22 20:48:17 CDT 2005


Mac OS 10.3.8, engine 2.6.2 build 77.

I guess, first I should explain why I used the "weird" script below..

It seems engine has a bug or at least inconsistency where

Put number of bgs would ignore nested grps but, in "repeat with j= 1 to 
number of bgs" the count WILL go through nested grps. So, if you have 
lets's say 4 bgs and bg # 3 has nested grp, above repeat loop would not 
count bg # 4 and would return bg 1, bg 2, bg3 and sub group of bg3 
leaving bg 4 out in cold.

So, I had to work around this behavior with the following script

on mouseUp
   put the short name of this stack into pSrcStack
   repeat forever
     add 1 to count
     if there is no bg count of stack pSrcStack then exit repeat
     put word 1 of the owner of bg count of stack pSrcStack into 
tWhichOwner
     if tWhichOwner = "Stack" then
       put the name of bg count of stack pSrcStack & cr after tBgNames
     end if
   end repeat
   answer tBgNames
end mouseUp

Now the caching? issue that puzzles me

If you create stack with 2 cards and 2 grps (I created both groups with 
background behavior "on") and remove both groups from card 1 and remove 
grp 1 from card 2 (so, now grp 1 is "unplaced" and grp 2 is only placed 
on card 2).

Note: Stack has "destroy stack" and "destroy window" set to true.

With this settings, if you run script above on just launched stack, the 
script would return

group "BG1"
group "BG2"

But if you go to next card and back and run script again it would return

group "BG1"

Only.

Related? behavior..

on mouseUp
   answer file "Point to the Stack"
   put it &cr& the short name of stack it
end mouseUp

Later,   you can refer to this stack from another button by it's short 
name only and it will work

  put the long name of stack "Short_Name" -- puts the long name

Checking if "Short_Name"  is among the lines of the OpenStacks returns 
false

Stack's  "DestroyStack " and "DestroyWindow " properties are set to 
true. And yes, all pending handlers have been completed and the engine 
was in idle for at least 15 minutes before I referred to  stack by 
short name and get response.

Again, is it some kind of caching that I was not aware about until now 
and if yes, can I trust such behavior in my scripts?

best regards
Tariel





More information about the metacard mailing list