Page 1 of 1

Keep only some objects in a page

Posted: Wed Oct 01, 2014 1:20 am
by ErikG
Hi,

How do I delete everything from a page except for a specified list of objects? I'm working on a subroutine where I create a new page and I will have an arbitrary number of objects in that new page that I want to get rid of.

As I understand it the PageSave @keep isn't useful because that creates a new workfile, but I want to stay in the same workfile!

Thanks,

/Erik.

Re: Keep only some objects in a page

Posted: Wed Oct 01, 2014 1:47 am
by ErikG
Nevermind, I found a simple solution:

Code: Select all

Subroutine Keep(String %KeepThese) %Everything = @Upper(@WLookup("*")) %KeepThese = @Upper(%KeepThese) %DeleteList = @WNotIn(%Everything,%KeepThese) %DeleteList = @WDrop(%DeleteList,"c resid") Delete {%DeleteList} EndSub