User Tools

Site Tools


api:dk11:java:tatukgis.jdk.tgis_layervector.addfield_string_tgis_fieldtype_integer_integer

Table of Contents

TGIS_LayerVector.AddField method

DK11 for Java | tatukgis.jdk.TGIS_LayerVector.AddField | Constructors | Fields | Methods | Properties | Events

Adds a new field.

Available also on: Delphi | .NET | ActiveX | Python.

Syntax

// Java
public void AddField(
  java.lang.String _name,
  TGIS_FieldType _type,
  int _width,
  int _decimal
);
// Oxygene
public
  procedure AddField(
    _name : String;
    _type : TGIS_FieldType;
    _width : Integer;
    _decimal : Integer
  ); virtual;

Parameters

Name Type Description
_name java.lang.String
String
name of field to be added
_type TGIS_FieldType type of field
_width int
Integer
width of field; not important for fields other then TGIS_FieldType.Number or TGIS_FieldType.String;
_decimal int
Integer
decimal places; not important for fields other then TGIS_FieldType.Number;

Remarks

Use this method to add a new field that will be marked as added and the final restructure will be performed on save. Unadd can be performed by RevertAll.

For TGIS_FieldType.String a _width will be treated as a hint. Value can represent any length but will be truncated on saving to the length defined in a current layer type. For example in TGIS_LayerSHP it will be truncated to 254 characters; in TGIS_LayerSQL will be truncated to the length defined in a database (defined on creation).

For TGIS_FieldType.Number a _width and a _decimal will be treated as a hint. Value can represent any float but will be truncated on save to the length limited in a current layer type. For example in TGIS_LayerSHP it will be truncated to exact _width & _precision value; in TGIS_LayerSQL will be stored as a float or Integer field (if _decimal = 0).

References

2022/11/16 01:49

Page Tools