NamedValueIndex
See Also: NamedValueAdd, NamedValueGet, NamedValueRemove, OnGetNavigateForwardData
Purpose
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).
Returns the index of the data array that contains the name/value pair. If the name is not found, it returns -1.
Return Type
Syntax
Use NameValuePairFunctions.pkg
Function NamedValueIndex tNameValuePair[] Data String sName Returns Integer
Parameters
- Data: An array of
tNameValuePairdata that will be searched. Usually thetWebNavigateData.NamedValuemember. - sName: The name that will be searched for.
What It Does
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 return the array index, which can be used to access that data value. If a match is not found, it returns -1.
Example
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.