|
Description
VECAddField() is used to add a new field to an existing vector layer.
Call Signature
int VECAddField ( int/string filespec, int segment_num, string field_name, string field_type [, string format_string] )
Return Value
int
Index of the new field. This will be one greater than the previous field count. 0 will be returned for failure.
Arguments
int/string filespec:
This can either be the handle returned by DBOpen(), or the name of an open file.
int segment_num:
The vector layer (segment) number being accessed.
string field_name:
The name of the new field being created.
string field_type:
The type of the new field being created. It should be one of "Integer", "Float", "Double", "String" or "CountedInt".
[ string format_string ]:
Optional field indicating how the field should be formatting when displayed in reports. This is a printf style format specifier.
Remarks
It is normally best to create new fields on a layer before adding any entities. Some file formats have a fixed set of fields, in which case VECAddField() will always fail.
See also
© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.