ArcPad Scripting Object Model
Name Property
See Also  Example  Send comments on this topic.
Field Object : Name Property

Glossary Item Box


Returns the name of the field.

Property type

Read-only property


variable = object.Name

Return Type



Demonstrates reading extra field properties. Note that these properties are only supported for RecordSets returned from DataSource objects.
Field Properties Example (VBScript)Copy Code
Function OpenAXF(p_strAXFPath)
      Dim pDS
      Set pDS = Application.CreateAppObject("DataSource")
      If (pDS.IsOpen) Then
            Set OpenAXF = pDS
            Set OpenAXF = Nothing
      End If
End Function

Function GetFileNameUI(p_extension, p_filter, p_title, p_flags) 
      GetFileNameUI = CommonDialog.ShowOpen(p_extension, p_filter, p_title, p_flags)
      If (IsEmpty(GetFileNameUI)) Then
            GetFileNameUI = ""
      End If
End Function

Sub ShowAllFieldProperties(p_strLayerName)
      Dim strFileName
      strFileName = GetFileNameUI("axf", "ArcPad AXF Files|*.axf","Select AXF File", &H1000)
      If ("" = strFileName) Then Exit Sub

      Dim pDS
      Set pDS = OpenAXF(strFileName)
      If (pDS Is Nothing) Then
            Console.Print "Open DataSource failed"
            Exit Sub
      End If

      '++ open the passed in layer name
      '++ (note there is no error handling or validation in this sample!!)
      Dim pRS
      'Set pRS = pDS.OpenLayer(p_strLayerName,Map.Extent,"[LANDUSE_ID] < 2000")
      Set pRS = pDS.OpenLayer(p_strLayerName)

      If (Not pRS Is Nothing) Then
            Console.Print "Number of fields: " & pRS.Fields.Count
            Dim pField
            For each pField In pRS.Fields
                  Console.Print "Field name: " & pField.Name
                  Console.Print "   READONLY: " & pField.Properties("READONLY")
                  Console.Print " HIDDEN: " & pField.Properties("HIDDEN")
                  Console.Print "   ISGEOMETRY: " & pField.Properties("ISGEOMETRY")
                  Console.Print " NULLABLE: " & pField.Properties("NULLABLE")
                  Console.Print "   ALIAS: " & pField.Properties("ALIAS")
            '++ close the RecordSet
            Set pRS = Nothing
      End If

      '++ close the DataSource
        Set pDS = Nothing
End Sub

'++ call ShowAllFieldProperties with the layer Parks
'++ note there is a Parks layer in the sample Riverside.axf installed with ArcPad
Call ShowAllFieldProperties("Parks")

See Also

© 2013 All Rights Reserved.