How to loop through stacks with same name?

J. Landman Gay jacque at hyperactivesw.com
Wed Apr 5 15:27:15 EDT 2023


I just created four same-named stacks and ran my suggested handler wrapped with timer commands. 
All four were deleted in 67 milliseconds. LC 10.0.0 DP 4.

put the milliseconds into tStart
repeat while "test" is in the mainstacks
    delete stack "test"
end repeat
answer the milliseconds - tStart

Ralph's idea to use filter is good too but slightly slower, at (a fairly insignificant) 79 
milliseconds:

put the milliseconds into tStart
filter the mainstacks with "test*" into tStacks
repeat for each line l in tStacks
    delete stack l
end repeat
answer the milliseconds - tStart

On 4/5/23 10:15 AM, Bob Sneidar via use-livecode wrote:
> Whoa! No I'm not! There's over 300 mainstacks just from Livecode!
> 
> Bob S
> 
> 
> On Apr 5, 2023, at 08:07, Bob Sneidar via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Oooh Pro Tip #276 from Jacque. I'm gonna use that one.
> 
> Bob S
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com




More information about the use-livecode mailing list