Page 1 of 1

Index of sVector

Posted: Fri Apr 11, 2014 4:42 am
by ErikG
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

Re: Index of sVector

Posted: Fri Apr 11, 2014 7:29 am
by EViews Gareth
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.