AFields()
This function puts information about table structure into an array. Read it as "Array from fields." In Visual FoxPro, this function returns a lot more information than in previous FoxPro versions.
Usage |
nFieldCount = AFIELDS( ArrayName [, cAlias | nWorkarea ] ) |
Parameter |
Value |
Meaning |
ArrayName |
Array Name |
The array to hold table structure information. |
cAlias |
Character |
The alias of the table whose structure information is placed in ArrayName. |
Omitted |
If nWorkarea is also omitted, use current work area. |
|
nWorkarea |
Numeric |
The number of the work area containing the table whose structure information is placed in ArrayName. |
Omitted |
If cAlias is also omitted, use current work area. |
|
nFieldCount |
Positive number |
The number of rows in the array, which is the number of fields in the specified table. |
Column |
Type |
Meaning |
1 |
Character |
Field name. |
2 |
Single Character |
Field type (see TYPE() for a list of field types). |
3 |
Numeric |
Field size. |
4 |
Numeric |
Decimal places. |
5 |
Logical |
Nulls allowed? |
6 |
Logical |
Code page translation NOT allowed? |
7 |
Character |
Field Validation rule (from DBC). |
8 |
Character |
Field Validation text (from DBC). |
9 |
Character |
Field Default value (from DBC). |
10 |
Character |
Table Validation rule (from DBC). |
11 |
Character |
Table Validation text (from DBC). |
12 |
Character |
Long table name (from DBC). |
13 |
Character |
Insert Trigger expression (from DBC). |
14 |
Character |
Update Trigger expression (from DBC). |
15 |
Character |
Delete Trigger expression (from DBC). |
16 |
Character |
Table Comment (from DBC). |
Example |
SELECT Customer = AFIELDS(aCustFlds) && structure array for Customer USE MyTable IN 0 = AFIELDS(aMyStruc, "MyTable") && structure array for MyTable |
See Also |
ADatabases(), ADBObjects(), ADir(), Array Manipulation, Copy Structure Extended, Create Table, DBGetProp(), FCount(), FSize(), RecSize(), Set NoCPTrans, Type() |