GetFieldInfo()

Summary

Returns the data type, display width, decimals, and index flag for a field.

Changes

In Version 2013 added field type "DateTime."

Syntax

field_info_array = GetFieldInfo(string field_spec)

Argument Contents
field_spec A field spec

Returns

An array indicating the following information about the field:

Element Type Contents
1 String The field's data type: "String", "Integer", "Real", or "DateTime"; see GetFieldType()
2 Integer The field's display width; see GetFieldWidth()
3 Integer The number of displayed decimal places for the field (zero (0) if the field is integer-typed or string-typed); see GetFieldDecimals()
4 Boolean The string "True" if the field is internally indexed, or the string "False" if it is not internally indexed

Notes

  • The first three elements of the returned array are exactly the same as those returned by GetFieldType(), GetFieldWidth(), and GetFieldDecimals(), respectively.

Example

inf = GetFieldInfo("States.Name")

Error Codes

Error Type Meaning
Error The input field specification is ambiguous
NotFound The input field does not exist

See Also

Function Summary
GetFieldType() Gets the data type of a field
GetFieldWidth() Gets the display width of a field
GetFieldDecimals() Returns the number of displayed decimal places for a real-typed field
GetFieldTableType() Gets the data type of a field in tables and joined views