Keep only some objects in a page

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

ErikG
Posts: 85
Joined: Wed Jan 23, 2013 1:18 am

Keep only some objects in a page

Postby ErikG » Wed Oct 01, 2014 1:20 am

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.

ErikG
Posts: 85
Joined: Wed Jan 23, 2013 1:18 am

Re: Keep only some objects in a page

Postby ErikG » Wed Oct 01, 2014 1:47 am

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


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest