Help in understanding table.copyrange

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator

sudesh
Posts: 51
Joined: Fri Nov 03, 2017 7:30 pm

Help in understanding table.copyrange

Postby sudesh » Thu Jan 18, 2018 7:08 am

Hi,

I would like to copy the range of one table to another using a loop.

tableT_{%a}_{%x}_{%j}.copyrange A2 N23 tableALL A2 ;

the first table will get copied into tableALL at A2 , the second will be at A2+ 22 ( number of row inserted = 22)

Can I used the following formula in my loop.

number of columns in tableT = c = 14
number of rows in tableT = r = 22

tableT_{%a}_{%x}_{%j}.copyrange 1 1 c r tableALL (1+ i)

Any help will be greatly appreciated.

Thanks

EViews Jason
EViews Developer
Posts: 701
Joined: Tue Sep 16, 2008 3:50 pm

Re: Help in understanding table.copyrange

Postby EViews Jason » Thu Jan 18, 2018 9:46 am

Copyrange unfortunately does not take expressions. So you will have to precalculate the source row and column as well as the destination row.

Here is an example:

Code: Select all

!c=24
!r=22

' copy 4 tables to tableAll
for !i=0 to 3
   !dest_r = (!i*!r) + 2
   tableT_{%a}_{%x}_{%j}.copyrange 1 1 !r !c tableAll !dest_r 1
next

sudesh
Posts: 51
Joined: Fri Nov 03, 2017 7:30 pm

Re: Help in understanding table.copyrange

Postby sudesh » Thu Jan 18, 2018 10:45 am

Thanks alots, it's working.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 5 guests