how to clear residual garbage in a stack?

J. Landman Gay jacque at hyperactivesw.com
Sat May 26 00:00:17 EDT 2018


I haven't actually tried it but would it work to just put empty into the 
field before deleting the card? That would be sort of a "clean as you go" 
approach.

--
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
On May 25, 2018 9:26:21 PM Neville Smythe via use-livecode 
<use-livecode at lists.runrev.com> wrote:

> So now we have confirmed the 
> “delete-card-with-unshared-textfield-leaves-unreferenced-text-which-compact-does-not-remove” 
> bug (thanks to Brian and Richard) the question remains how to actually 
> remove the garbage.
>
> As Brian says deleting the background groups will remove the residual text; 
> you then  have the task of replacing the groups. I have found that a 
> simpler method: turning on sharedText, then turning it back off and 
> replacing text also works.
>
> So, a recipe is
> 1. Copy the target stack, don’t work on the original
> 2. Go through the stack (and its substacks) to find background groups which 
> have fields with sharedText false (this is an outer loop for each stack)
> 3. Find all cards which such groups
> 4. Save the text from every found field from every found card into an array
> 5. Turn on sharedText for each field
> 6. Visit each card and put empty into each found field (not sure if this 
> step is necessary, but I think it is)
> 7. compact the stack
> 8. Turn off sharedText for each field
> 9. Visit each card to replace the individual text saved in the array
> 10.Save the stack.
>
> Sounds complex but the process took only a couple of seconds to clean up my 
>  9MB stack with 325 cards + lots of substacks and lots of groups. It saved 
> 1.5MB, not as much as I was hoping but still worthwhile. That’s 15% off the 
> time Windows 10 users have wait for save to finish.
>
> This is not a workaround for the bug. It is a fix for affected stacks.
>
> Neville Smythe
> _______________________________________________
> 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







More information about the Use-livecode mailing list