## Help in understanding table.copyrange

For questions regarding programming in the EViews programming language.

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

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

### Help in understanding table.copyrange

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: 709
Joined: Tue Sep 16, 2008 3:50 pm

### Re: Help in understanding table.copyrange

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 tableAllfor !i=0 to 3   !dest_r = (!i*!r) + 2   tableT_{%a}_{%x}_{%j}.copyrange 1 1 !r !c tableAll !dest_r 1next`

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

### Re: Help in understanding table.copyrange

Thanks alots, it's working.