NamedValueIndex - cWebObject

Gets the array index for the passed name of a tNameValuePair array that is part of tWebNavigateData during navigation in a mobile web application (drilldown interface)

Type: Function

Return Data Type: Integer

Parameters: tNameValuePair[] Data String sName

ParameterDescription
DataAn array of tNameValuePair data that will be searched. Usually the tWebNavigateData.NamedValue member.
sNameThe name that will be searched for.


Return Value

Returns the index of the data array that contains the name/value pair. If the name is not found, returns -1.


Syntax
Function NamedValueIndex tNameValuePair[] Data String sName Returns Integer

Call: Get NamedValueIndex Data sName to IntegerVariable


Description

NamedValueIndex is used to retrieve the array index for a named pair during forward and back navigation in a mobile web application (drilldown interface).

It performs a case-insensitive search for the passed name. If a match is found, the function will the array index, which can be used to access that data value. If a match is not found value it returns -1.

Get NamedValueGet NavigateData.NamedValues "returnValue" to iIndex
If (iIndex<>-1)
    Move NavigateData.NamedValues[iIndex].sValue to sValue
    WebSet psValue of oName to sValue
    WebSet pbChanged of oName to True
End


If you don't need to actually know if a named value pair exists you can use NamedValueGet to return the named value or an empty string.

See Also

NamedValueGet | NamedValueRemove | OnGetNavigateForwardData | tWebNavigateData.tNameValuePair