Subscribe

RSS Feed (xml)

Powered By

Skin Design:
Free Blogger Skins

Powered by Blogger

Get $125 within 24 hours
Enter your email address:
Enter the security code shown:

Visual Basic | Function AFIELDS()

Function AFIELDS()
AFIELDS([], [], [], []) --> nFields


AFIELDS() is an array function that fills a series of arrays (structure attribute arrays) with the structure of the database file currently open, one element in each array per field. AFIELDS() works like ADIR(), filling a series of existing arrays with information. To use AFIELDS(), you must first create the arrays to hold the database structure information, each with the same number of elements as the number of fields (i.e. FCOUNT()). Once the structure attribute arrays are created, you can then invoke AFIELDS() to fill the structure arrays with information about each field.
By default, AFIELDS() operates on the currently selected work area. It can operate on an unselected work area if you specify it within an aliased expression (see example below).
AFIELDS() is a compatibility function and therefore is not recommended. It is superseded by DBSTRUCT(), which does not require the existence of any arrays prior to invocation and returns a multidimensional array containing the current database file structure.

is the array to fill with field names. Each element is a character string.

is the array to fill with the type of fields in

. Each element is a character string.

is the array to fill with the widths of fields in

. Each element is numeric data type.

is the array to fill with the number of decimals defined for fields in . Each element is numeric data type. If the field type is not numeric, the element is zero.
Returns :
AFIELDS() returns the number of fields or the length of the shortest array argument, whichever is less. If no arguments are specified, or if there is no file in USE in the current work area, AFIELDS() returns zero.

Example :
This example demonstrates how AFIELDS() and ACHOICE() can be
used together to create a fields picklist:

USE Sales NEW
PRIVATE aFieldNames[FCOUNT()]
AFIELDS(aFieldNames)
@ 1, 0 TO 10, 10 DOUBLE
nChoice := ACHOICE(2, 1, 9, 9, aFieldNames)
@ 12, 0 SAY IF(nChoice != 0, aFieldNames[nChoice],;
"None selected")
RETURN

This example uses AFIELDS() with an aliased expression to fill
arrays with the structure of Sales.dbf, open in an unselected work
area:

LOCAL aFieldNames, aTypes, aWidths, aDecimals
USE Sales NEW
USE Customer NEW
//
aFieldNames := Sales->(ARRAY(FCOUNT()))
aTypes := Sales->(ARRAY(FCOUNT()))
aWidths := Sales->(ARRAY(FCOUNT()))
aDecimals := Sales->(ARRAY(FCOUNT()))
//
Sales->(AFIELDS(aFieldNames, aTypes, ;
aWidths, aDecimals))

JOBGOLDS

Related Link :

1. AFILIATE

2. Browsing dibayar $ Dollar $
a.
ClixSense
b. Bux.to

3. Note book driver acer :
a. TravelMate
b. Extensa
c. Aspire
d. Acer Note
e. Nouvo