When does a Stack Actually Die in the IDE???
Richard Gaskin
ambassador at fourthworld.com
Fri Apr 14 13:08:05 EDT 2006
J. Landman Gay wrote:
> Richard Gaskin wrote:
>
>> Sounds like an opportunity for the gang here to come up with a fast way
>> to parse the stack name.
>
> function objStack pLongID
> return value(word wordoffset("stack",pLongID)+1 of pLongID)
> end objStack
>
> Didn't time it. One-liner though. :)
Well done: 0.027ms (1GHz G4)
I'd considered the value function, but sometimes I get skittish about it
for fear of object names that may evaluate to valid expressions.
But apparently since the name is in quotes it doesn't matter -- I even
named my stack "time()" and it still only returned the first-level
evaluation (removing the quotes to obtain the string "time()").
Good job, Jacque.
--
Richard Gaskin
Managing Editor, revJournal
_______________________________________________________
Rev tips, tutorials and more: http://www.revJournal.com
More information about the use-livecode
mailing list