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

Marielle Lange mlange at lexicall.org
Sat Apr 15 20:38:09 EDT 2006


What about these other options?

function ObjStack2 pObj
   put the long id of pObj into tObj
   return char 2 to -2 of word -1 of tObj
end ObjStack2

5.65% faster  than ObjStack according to 4W RevBench (50,000  
repetitions)

Or

function ObjStack3 pObj
   put the long id of pObj into tObj
   replace " of stack " with tab in tObj
   set the itemdel to tab
   return char 2 to -2 of item -1 of tObj
end ObjStack3

1.81% faster than ObjStack according to 4W RevBench  (50,000  
repetitions)

>> Richard Gaskin wrote:
>> Sounds like an opportunity for the gang here to come up with a  
>> fast way to parse the stack name.
>>
>> Here's a starting point, which clocks in at 0.1349ms on a 1GHz G4:
>>  function ObjStack pObj
>>   put the long id of pObj into tObj
>>   get offset(" of stack "&quote, tObj)
>>   delete char 1 to (it+10) of tObj
>>   get offset(quote,tObj)
>>   return char 1 to (it-1) of tObj end ObjStack
>
-- 
  Richard Gaskin
  Managing Editor, revJournal



------------------------------------------------------------------------ 
--------
Marielle Lange (PhD),  Freelance Academic

Widged                                                                   
http://widged.com/
Easy access to lexical databases                    http:// 
lexicall.widged.com/
Supporting Education Technologists              http:// 
revolution.widged.com/wiki/






More information about the use-livecode mailing list