When does a Stack Actually Die in the IDE???

Mark Smith mark at maseurope.net
Fri Apr 14 17:20:39 EDT 2006


I just had a doh! moment  in response to your <the short name of  
pStackLongID>, but then in order to see how much faster the engine  
does this, I tested it the same way I tested my first tries (which  
was actually with 10000 iterations, not 1000), and

function stackIsOpen pLongID
   return (the short name of pLongID is among the lines of the  
openstacks)
end stackIsOpen

takes nearly 600 ms!

And you're right, of course, the original question was as you  
described. I didn't read it carefully enough. Though, as far as I can  
see, the original stackIsOpen function will work ok for the long id  
of any control of a main stack, provided the stack  has a file name.

Best,

Mark

On 14 Apr 2006, at 21:54, J. Landman Gay wrote:

> J. Landman Gay wrote:
>> Mark Smith wrote:
>>> The best I could do was:
>>>
>>> function stackIsOpen pLongID
>>>   set the itemDelimiter to "/"
>>>   return (char 1 to -6 of item -1 of pLongID) is among the lines  
>>> of  the openStacks
>>> end stackIsOpen
>>>
>>> which on a 1.5mhz G4 powerbook took 150 ms for 1000 iterations.   
>>> (checking the windowID took 500 ms).
>>>
>>> The trouble with 'value(word wordoffset("stack",pLongID)+1 of   
>>> pLongID)' is that given the long id of a stack, it returns the  
>>> full  path of the stack, so is never in the openStacks.
>> True. The original request was for a way to identify the stack  
>> that held the long ID of an object in the stack, so that's what my  
>> script did. But you're right, it wouldn't work with file paths.
>> For long IDs that are stack file paths, you can use:
>>   get (the short name of pStackLongID is in the openstacks)
>
> Oh, and re-reading this, I think your method is better regarding  
> "among the lines of" -- it prevents one of those forward-looking  
> potential bugs we've been talking about on the list recently. So I  
> revise myself:
>
>   get (the short name of pStackLongID is among the lines of the  
> openstacks)
>
> -- 
> Jacqueline Landman Gay         |     jacque at hyperactivesw.com
> HyperActive Software           |     http://www.hyperactivesw.com
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list