AFIELDS()
Fills referenced arrays with database field information
- Syntax
-
- AFields(<aNames>[,<aTypes>][,<aLen>][,<aDecs>]) --> <nFields>
- Arguments
-
- <aNames> Array of field names
- <aTypes> Array of field names
- <aLens> Array of field names
- <aDecs> Array of field names
- Returns
-
- <nFields> Number od fields in a database or work area
- Description
-
- This function will fill a series of arrays with field names,field types,field lenghts, and number of field decimal positions for the currently selected or designed database. Each array parallels the different descriptors of a file's structure.The first array will consist of the names of the fields in the current work area.All other arrays are optional and will be filled with the corrensponding data. This function will return zero if no parameters are specified or if no database is avaliable in the current work area.Otherwise, the number of fields or the lenght of the shortest array argument, witchever is smaller, will be returned.
Examples
FUNCTION Main()
LOCAL aNames:={},aTypes:={},aLens:={},aDecs:={},nFields:=0
USE Test
dbGoTop()
nFields:=aFields(aNames,aTypes,aLens,aDecs)
? "Number of fields", nFields
RETURN NIL
- Status
- Ready
- Compliance
-
- AFIELDS() is fully CA-Clipper compliant.
- Files
-
- Library is rdd