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


_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to