GetFieldWidth()

Summary

Gets the display width of a field.

Syntax

field_width = GetFieldWidth(string field_spec)

Argument Contents
field_spec A field spec

Returns

An integer indicating the display width of the field.

Notes

  • The display width is used as the initial width of the field when it is displayed in a new editor. It is also the width of the field when it is exported (see ExportView()).

  • The display width can be changed by SetFieldWidth(), and also by widening or narrowing a corresponding column heading in an editor.

  • The display width is not necessarily equal to the actual width (number of characters) of the field in the data file.

Example

curr_width = GetFieldWidth("States.Population")
SetFieldWidth("States.Population", curr_width + 2)

Error Codes

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

See Also

Function Summary
SetFieldWidth() Changes the display width of a field
GetFieldInfo() Returns the data type, display width, decimals, and index flag for a field