VECGetFieldFormat, VECGetLayerName, VECGetLayerDesc, VECGetFieldDesc, and VECGetFieldType

Demonstrate how to get various field attribute information of a layer.

Remarks

This example illustrates how to get detailed attribute information of a layer.

Code

local int Layer
local int tfid, int Count, int i
local string fieldname 
local string fieldformat 
local string fielddesc
local string fieldtype 
try
tfid = DBOpen( GetPCIHOME() + "/demo/irvine.pix")
Layer = 28
print "Layer: ", Layer, VECGetLayerName(tfid, Layer), VECGetLayerDesc(tfid, Layer)
count =VECGetFieldCount(tfid, Layer)
print count
for i = 1 To count
        fieldname = VECGetFieldName(tfid, Layer, i)
        fielddesc = VECGetFieldDesc(tfid, Layer, i)
        fieldformat = VECGetFieldFormat(tfid, Layer, i)
        fieldtype = VECGetFieldType(tfid, Layer, i)
        Print "Field name: " + fieldname+ "Desc: "+ fielddesc+"Type: "+ fieldtype+"Format: "+ fieldformat
endfor
call DBClose(tfid)
onerror
   print "Error: "+ GetLastErrorMessage()
endonerror

Output

 
Layer: 28VectorAII-Arcs Layer
7
Field name: StartNodeIdDesc: Type: IntegerFormat: %8d
Field name: EndNodeIdDesc: Type: IntegerFormat: %8d
Field name: LeftAreaIdDesc: Type: IntegerFormat: %8d
Field name: RightAreaIdDesc: Type: IntegerFormat: %8d
Field name: LENGTHDesc: Type: DoubleFormat: %20.8f
Field name: LULC#Desc: Type: IntegerFormat: %8d
Field name: LULC-IDDesc: Type: IntegerFormat: %8d

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.