MapWinGIS:Table 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 table. Note: The table must be set to allow editing before a field can be inserted into the table.
See also Field and StartEditingTable


VB.NET Usage

Function EditInsertField(Field As MapWinGIS.Field, ByRef FieldIndex As Integer, Optional cBack As MapWinGIS.ICallback) As Boolean

            Parameters

Field

The new field to be inserted into the table.
FieldIndex Reference parameter. The desired index to be used for the new field being inserted into the table. If the desired index is invalid or unavailable, the actual index used for the new field will be returned.
cBack The ICallback object which will receive progress and error messages while the new field is being inserted into the table.
ReturnValue A boolean value representing the success or failure of inserting the new field into the table.

Sample Code

    Private Sub TableInsertField()
        Dim table As New MapWinGIS.Table()
        Dim field As New MapWinGIS.Field()
        Dim fieldindex As Integer
        Dim success As Boolean
        'Set the desired index for the new field in the table
        fieldindex = 2
        'Open a table
        success = table.Open("C:\test.dbf")
        'Start editing the table
        success = table.StartEditingTable()
        'Insert a field into the table at index 2
        success = table.EditInsertField(field, fieldindex, Me)
    End Sub
  

VB 6 Usage
Function EditInsertField(Field As Field, ByRef FieldIndex As Long, Optional cBack As ICallback) As Boolean
            Parameters

Field

The new field to be inserted into the table.
FieldIndex Reference parameter. The desired index to be used for the new field being inserted into the table. If the desired index is invalid or unavailable, the actual index used for the new field will be returned.
cBack The ICallback object which will receive progress and error messages while the new field is being inserted into the table.
ReturnValue A boolean value representing the success or failure of inserting the new field into the table.

Sample Code

    Private Sub TableInsertField()
        Dim table As New MapWinGIS.table
        Dim field As New MapWinGIS.field
        Dim fieldindex As Long
        Dim success As Boolean
        'Set the desired index for the new field in the table
        fieldindex = 2
        'Open a table
        success = table.Open("C:\test.dbf")
        'Start editing the table
        success = table.StartEditingTable()
        'Insert a field into the table at index 2
        success = table.EditInsertField(field, fieldindex, Me)
    End Sub

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

This page has been accessed 1,463 times. This page was last modified on 9 November 2005, at 17:44.