index()

Get index of name in an array

Syntax
index(Array, Name, CaseSensitive, Length)

Name Description Range Type Default Required
Array Array of strings   string array   yes
Name Name or name of a simulator expression variable to find in array   string   yes
CaseSensitive specifies if a case sensitive search is to be done [NO, YES] boolean YES no
Length compares length number of characters [0, ∞) integer 0 no

Examples

sA = makearray(3, "Zero", "One", "Two")
returns an array of three strings
indx = index(sA, "One")
returns 2
indx = index(sA, "one", 1)
returns -1
indx = index(sA, "On", 1, 2)
returns 2
varName = "One"
indx = index(sA, varName)
returns 2

See Also

makearray(), get_array_size()

Notes/Equations

This function finds the index of a search string or name of a Simulator Expression variable in the given string array. If a match is found, the index (starts at 1) is returned. Otherwise, a -1 is returned.

 

Privacy Statement  | Terms of Use  | Legal | Contact Us  | © Agilent 2000-2008 

Contents
Additional Resources