Hello,
I would like to access certain cells inside a table using variable indices. For example, to print numbers down the 2nd column, I thought this would work:
______________________
table mytable
for !i=1 to !i=5
regout(2,!i)=!i
next
______________________
But, this did not work, and after running the program I get no error messages...
Thanks in advance,
-cap
Access table cells with variables
Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13307
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Access table cells with variables
Sorry, its just the name of the same table, I meant to edit my code as follows:
______________________
table mytable
for !i=1 to !i=5
mytable(2,!i)=!i
next
______________________
Any help would still be appreciated, thanks,
-cap
______________________
table mytable
for !i=1 to !i=5
mytable(2,!i)=!i
next
______________________
Any help would still be appreciated, thanks,
-cap
Re: Access table cells with variables
Ok, it seems now that the code does actually work, but now I can not use the loop variable in computations. For example, when I assign a cell the value !i+10, it still only puts in the value !i.
___________________________
table mytable
for !i=1 to !i=5
mytable(1,!i)=!i+10
next
___________________________
Any ideas?
-cap
___________________________
table mytable
for !i=1 to !i=5
mytable(1,!i)=!i+10
next
___________________________
Any ideas?
-cap
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13307
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Access table cells with variables
You have the syntax of the for loop incorrect.
Your code should be:
Your code should be:
Code: Select all
for !i=1 to 5
mytable(1,!i)=!i+10
next
Follow us on Twitter @IHSEViews
Re: Access table cells with variables
Ah, sorry, dumb question, thanks very much though.
-cap
-cap
Who is online
Users browsing this forum: No registered users and 27 guests