Fills the array with the current table's structural information. Returns the number of fields whose characteristics are stored.

Syntax

<oRef>.fields( )

<oRef>

A reference to the array in which you want to store the field information. fields( ) will automatically redimension or increase the size of the array to accommodate the field information, if necessary.

Property of

Array

Description

Use fields( ) to store information about the structure of the current table to an array, which is dynamically resized so all returned information fits in the array. The resulting array is always a two-dimensional array, unless there are is no table open in the current work area, in which case the array is not modified.

fields( ) stores the following information for each field in each row of the array. The data type for each is shown in parentheses:

Column 1

Column 2

Column 3

Column 4

Field name
(character)

Field type
(character)

Field length
(numeric)

Decimal places
(numeric)

 

dBASE Plus uses the following codes for field types (some codes are used for more than one field type):

Code

Field type

B

Binary

C

Character, Alphanumeric

D

Date, Timestamp

F

Float, Double

G

General, OLE

L

Logical, Boolean

M

Memo

N

Numeric

fields( ) stores the same information into an array that COPY STRUCTURE EXTENDED stores into a table, except fields( ) doesn't create a column containing FIELD_IDX information.