Index of sVector

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason

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

Index of sVector

Postby ErikG » Fri Apr 11, 2014 4:42 am

Hi,

How to I get the index of a particular element of an svector:

Example of what this function could look like:

SVector(3) sVRows

sVRows(1) = "First"
sVRows(2) = "Second"
sVRows(3) = "Third"

!iK = sVRows.GetIndex("Second")

' !iK should be equal to 2

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

Re: Index of sVector

Postby EViews Gareth » Fri Apr 11, 2014 7:29 am

There's no built in function to do that. You'll have to simply loop through the rows until you find a match.

Of course you'll have to decide what you want to do in the case of duplicates.


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests