Share via


DictTable.Fieldname2id(String) Method

Definition

Returns the field ID of a field that is specified by name.

public:
 virtual int Fieldname2id(System::String ^ name);
public virtual int Fieldname2id (string name);
abstract member Fieldname2id : string -> int
override this.Fieldname2id : string -> int
Public Overridable Function Fieldname2id (name As String) As Integer

Parameters

name
String

The name of the field for which the field ID is being retrieved.

Returns

The field ID of the field that is specified by the name parameter; 0 (zero) if name does not represent a valid field name for the table.

Remarks

The following example shows the retrieval of a field ID by its field name.

DictTable dt; 
fieldId   fId; 
dt = new DictTable(tablenum(CustTable)); 
if (dt) 
{ 
    fId = dt.fieldName2Id("Pager"); 
    // Use the field ID as needed. 
    // This example merely prints out the field ID. 
    print (strfmt("fId: %1", fId)); 
}

Applies to