FCount Function (Usual) | |
Return the number of fields in the current database file.
Namespace:
XSharp.RT
Assembly:
XSharp.RT (in XSharp.RT.dll) Version: 2.21
Syntax FUNCTION FCount(
uArea AS USUAL
) AS DWORD
public static uint FCount(
Usual uArea
)
Request Example
View SourceParameters
- uArea
- Type: Usual
Specifies the work area name or number for a table from which the value must be retrieved.
Return Value
Type:
DWord
If there is no database file open, FCount() returns 0.
Remarks
FCount() is useful in applications containing data-independent programs that can operate on any database file.
These include generalized import/export and reporting programs. Typically, you use FCount() to establish the upper limit of a FOR...NEXT or DO WHILE loop that processes a single field at a time.
By default, this function operates on the currently selected work area.
It can be made to operate on an unselected work area by specifying
it within an aliased expression or by calling the overload that accepts a workarea
parameter (a workarea number or alias ).
Examples
This example uses FCount() to return the number of fields in the current and an unselected work area:
1USE Sales NEW
2USE Customer NEW
3? FCount()
4? Sales ->(FCount())
This example uses FCount() to declare an array with field information:
1LOCAL aFields := ARRAY(FCount())
2AFields(aFields)
This example uses FCount() as the upper boundary of a FOR loop that processes the list of current work area fields:
1LOCAL nField
2USE Sales NEW
3FOR nField := 1 UPTO FCount()
4 ? FIELDNAME(nField)
5NEXT
See Also