FortranGIS  Version2.5
integer function, public shapelib::dbfaddfield ( type(shpfileobject), intent(inout)  hshp,
character(len=*), intent(in)  pszfieldname,
integer, intent(in)  etype,
integer, intent(in)  nwidth,
integer, intent(in)  ndecimals 
)

It adds a new field to an existing dataset.

Note that fields can only be added to datasets with no dbf records, though this is limitation of this API, not of the file format. This function returns the number of the new field, starting from 0, or -1 in case of error.

Parameters
[in,out]hshpshapefile object to update
[in]pszfieldnamethe name of the new field, at most 11 characters will be used
[in]etypethe type of the new field, one of the ft* constants
[in]nwidththe width of the field to be created in characters
[in]ndecimalsthe number of decimals in a floating point representation for fields of type ftdouble, for the other types it should be 0

Definition at line 759 of file shapelib.F90.