User Tools

Site Tools


api:dk11:delphi:gislayervector.tgis_layervector.deletefield_string

Table of Contents

TGIS_LayerVector.DeleteField method

DK11 for Delphi | GisLayerVector.TGIS_LayerVector.DeleteField | Constructors | Fields | Methods | Properties | Events

Delete field.

Available also on: .NET | Java | ActiveX.

Syntax

// Delphi
public
  procedure DeleteField(
    const _name : String
  ); virtual;
// C++ Builder
public:
  virtual void DeleteField(
    const UnicodeString _name
  );

Parameters

Name Type Description
_name String name of field to be deleted

Remarks

Use this method to delete a field, which will be marked as deleted and final restructure will be performed upon save.

Undelete can be performed by RevertAll.

Internally it uses FieldInfo method with _name param.

Example

This is a simple procedure to manipulate fields.

Delphi

procedure MyClass.SaveInfo( const _shp : TGIS_Shape ) ;
var
  CurrentName : String;
begin
   // Read the current fieldname of the first field and
   // rename the field to a name determined by the user.
   CurrentName := _shp.Layer.FieldInfo(0)^.NewName;
 
   _shp.Layer.RenameField(CurrentName, edtInfoField.Text, 256, 0);
 
   // Make the value from the "edtInfoValue" editbox to
   // be the value of the field.
   _shp.SetField(edtInfoField.Text, edtInfoValue.Text);
 
   // delete the field, just like that
   _shp.Layer.DeleteField(CurrentName);
end;
2019/08/13 10:50