02
05
每日一记 - FindField
作者:独木舟 日期:2009-02-05
用途: 从field name 查找field index
说明原文:
FindField Method
Finds the index of the named field in the fields collection.
Syntax
object.FindField (Name )
The FindField method syntax has the following object qualifier and arguments:
| Part | Description |
|---|---|
| object | An object expression that evaluates to an object in the Applies To list. |
| Name | Required. A string expression that represents the Name. |
Return Value
Long
Product Availability
Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.
Remarks
If FindField returns -1, the Field could not be found in the Fields collection.
FindField Example
Dim i As Integer
Dim pFields As IFields
Dim pField As IField
'Get Fields
Set pFields = pFeatClass.Fields
'Find the field named "average_income"
i = pFields.FindField("average_income")
'Set the current field
Set pField = pFields.Field(i)
'Delete field from featureclass
pFeatClass.DeleteField pField
评论: 0 | 引用: 0 | 查看次数: -
发表评论
上一篇
下一篇

文章来自:
Tags: 