MapWinGIS:Shapefile EditInsertField

This is a back-up of the WIKI.
Not all links might work
We're working on a new wiki.

Main Page | Recent changes | View source | Page history | Log in / create account |

Printable version | Disclaimers | Privacy policy

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

Retrieved from "http://mapwindow.org/wiki/index.php/MapWinGIS:Shapefile_EditInsertField"

This page has been accessed 2,782 times. This page was last modified on 9 November 2005, at 18:28.