MapWindow Home
Search MapWindow.org


  • Home
    • Download
    • Why MW
    • FAQ
    • Contact
  • Products
    • MapWindow
    • ActiveX
    • Plug-ins
  • Software Dev
    • Sample Code
    • Scripts
    • Source
    • Bugs
    • Support
    • Languages
  • Site Tools
    • Forums
    • Tutorials
    • Mailing Lists
    • Team
    • Site Stats
    • Links
  • Get Stuff
    • Buy a CD
    • Buy a T-Shirt
    • MW Book
    • ActiveX Book
    • Donate
    • Buy Support
  • Documentation
    • MWGIS App. User Guide
    • GISTools User Guide
    • MW Plug-ins Dev. Guide
    • MWGIS ActiveX Dev. Guide
    • MWGeoProc Dev. Guide

MapWinGIS:Shapefile EditInsertField

From MapWindow GIS

Jump to: navigation, search

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://www.mapwindow.org/wiki/index.php/MapWinGIS:Shapefile_EditInsertField"
Views
  • Page
  • Discussion
  • View source
  • History
Personal tools
  • Log in / create account
  • What links here
  • Related changes
  • Upload file
  • Special pages
  • Printable version
  • Permanent link

Geospatial Software Lab

Copyright © 2008 - MapWindow Open Source Team
( last updated: December 03 2008.)
Home | Donate | Download | MapWindow GIS Desktop | MapWinGIS.ocx | Plug-ins | Contact | Lists | Bugs | Sample Code | Documentation
Code Repository | Open Source License | Discussion Forum | Wiki | Join the Team | Site Statistics | Links