AFIELDS()

From Lianjapedia
Jump to: navigation, search

Purpose

Function to fill an array with table structure details

Syntax

AFIELDS(<array> [,<workarea | alias>])

See Also

AADD(), AAVERAGE(), ACOPY(), ADEL(), ADESC(), ADIR(), AELEMENT(), AFILL(), AINS(), ALEN(), AMAX(), AMIN(), APPEND FROM ARRAY, ARRAY(), ASCAN(), ASIZE(), ASORT(), ASTORE(), ASTRING(), ASUBSCRIPT(), ASUM(), ATABLES(), COPY TO ARRAY, DECLARE, DIMENSION, GATHER, IN_ARRAY(), IS_ARRAY(), LOCAL, PRIVATE, PUBLIC, RELEASE, RESTORE, SAVE, SCATTER

Description

The AFIELDS() function returns the number of fields in the table in the current or specified cursor/workarea and loads the information detailed in the table below into the 18 columns of the array <array>. Each row in the array corresponds to a field in the table. If the optional <workarea | alias> is specified, then the function will operate in the required location, otherwise it will operate in the current cursor/workarea.

The SET FIELDS command can be used to restrict the active fields.


Column Information Data Type
1 Field name Character
2 Field type:

C = Character

Y = Currency

D = Date

T = DateTime

B = Double

F = Float

G = General

I = Integer

L = Logical

M = Memo

N = Numeric

Q = Varbinary

V = Varchar and Varchar (Binary)

W = Blob

Character
3 Field width Numeric
4 Decimal places Numeric
5 Null values allowed Logical
6 Code page translation not allowed Logical
7 Field validation expression Character
8 Field validation text Character
9 Field default value Character
10 Table validation expression Character
11 Table validation text Character
12 Long table name Character
13 Insert trigger expression Character
14 Update trigger expression Character
15 Delete trigger expression Character
16 Table comment Character
17 NextValue for autoincrementing Numeric
18 Step for autoincrementing Numeric


Example

open database southwind
use customers
? afields(myarr)
display memory