MapWinGIS:Shapefile EditInsertField
From MapWindow GIS
EditInsertField
Inserts a new field into the shapefile attribute table. Note: The shapefile attribute table must be in editing mode to insert a new field..
See also Field
VB.NET Usage
Function EditInsertField(NewField As MapWinGIS.Field, ByRef FieldIndex As Integer, cBack As MapWinGIS.ICallback) As Boolean
Parameters
|
NewField | The object to be inserted into the specified field. |
| FieldIndex | Reference parameter. The desired index for the new field. If the desired index is not valid, the actual index the object is placed in will be returned. |
| cBack | The ICallback object which will receive progress and error messages while the field is being inserted into the attribute table. |
| ReturnValue | A boolean value representing the success or failure of inserting the field into the attribute table. |
Sample Code
Private Sub EditInsertField()
Dim sf As New MapWinGIS.Shapefile()
Dim field As New MapWinGIS.Field()
Dim fieldindex As Integer
'Set the field index
fieldindex = 0
'Switch the shapefile attribute table into editing mode
sf.StartEditingTable()
'Insert new field into the shapefile attribute table at index 0 if available
sf.EditInsertField(field, fieldindex)
End Sub
VB 6 Usage
Function EditInsertField(NewField As Field, ByRef FieldIndex As Long, cBack As ICallback) As Boolean
Parameters
|
NewField | The object to be inserted into the specified field. |
| FieldIndex | Reference parameter. The desired index for the new field. If the desired index is not valid, the actual index the object is placed in will be returned. |
| cBack | The ICallback object which will receive progress and error messages while the field is being inserted into the attribute table. |
| ReturnValue | A boolean value representing the success or failure of inserting the field into the attribute table. |
Sample Code
Private Sub EditInsertField()
Dim sf As New MapWinGIS.Shapefile
Dim field As New MapWinGIS.field
Dim fieldindex As Long
'Set the field index
fieldindex = 0
'Switch the shapefile attribute table into editing mode
sf.StartEditingTable
'Insert new field into the shapefile attribute table at index 0 if available
sf.EditInsertField field, fieldindex
End Sub
















