FindChildIndex method

The FindChildIndex method returns the index of the specified child object that is contained within a runtime DCO object. You can use this method when you know the name of the child object, and you need to pass the position of the child object to a variable.

Syntax

VBScript
oDCO FindChildIndex (lpszName as String ) as Long
C#
int FindChildIndex(string lpszName)

Applies to

All objects except batch.

Arguments

lpszName
The ID (name) of the child object.

Returns

Returns the index of the specified child object, where 0 is the first child; returns –1 if the specified child is not found.

VBScript example

This example returns the index of the Client_ID field, and passes the index to the GetChild method.
Dim ClientFldVal
ClientFldVal = objRTSurvey.FindChildIndex("Client_ID")
Call objRTSurvey.GetChild(ClientFldVal)

C# example

This example returns the index of the Vendor field:
int nVendorIndex = m_oDCOPage.FindChildIndex("Vendor");