assigning a row of the table from a vector of strings

For questions regarding programming in the EViews programming language.

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

r_samin
Posts: 5
Joined: Mon Jul 10, 2023 1:33 am

assigning a row of the table from a vector of strings

Postby r_samin » Mon Jul 10, 2023 10:48 pm

Hi
I want to store the name of my columns in a separate object for strings (I'm guessing an svector is suitable)
I would like to fill the first row of my table using the values stored in this object. if this operation is possible in eviews12, could someone help me with the syntax?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13600
Joined: Tue Sep 16, 2008 5:38 pm

Re: assigning a row of the table from a vector of strings

Postby EViews Gareth » Tue Jul 11, 2023 10:22 am

For a table object the only way to do it is to loop through the elements of the string (or svector) and insert them into the table one at a time.

r_samin
Posts: 5
Joined: Mon Jul 10, 2023 1:33 am

Re: assigning a row of the table from a vector of strings

Postby r_samin » Tue Jul 11, 2023 8:08 pm

Thanks, Gareth
So it will be something like this

Code: Select all

table tab01 scalar a=@wcount(svec01) for !i=1 to a tab01(!i,1)=svec01(!i,1) next


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests