Click or drag to resize

DbServer.Average Method

X#
Calculate the average of a series of numeric expressions, based on the number of actual records involved.

Namespace:  VO
Assembly:  VORDDClasses (in VORDDClasses.dll) Version: 2.21
Syntax
 VIRTUAL METHOD Average(
	acbExpression,
	cbForBlock,
	cbWhileBlock,
	uScope
) AS USUAL CLIPPER
Request Example View Source

Parameters

acbExpression (Optional)
Type: Usual
The single expression to be averaged or the array of expressions to be averaged.
cbForBlock (Optional)
Type: Usual
The condition evaluated for each record in the scope; if TRUE, the record is included in the processing. It provides the same functionality as the FOR clause of record processing commands.
cbWhileBlock (Optional)
Type: Usual
The condition evaluated for each record from the first record until the condition returns FALSE. It provides the same functionality as the WHILE clause of record processing commands.
uScope (Optional)
Type: Usual
The range of records to process, providing the same functionality as the ALL, REST and NEXT clauses of record processing commands.
ConstantDescription
DBSCOPEALL The scope is all the records in the table. This is the default, although if a WHILE condition is specified, the scope becomes DBSCOPEREST.
DBSCOPERESTThe scope is the remaining records in the table from the current position.

Return Value

Type: Usual
An array that contains the averages for each field or expression specified. If a single expression was specified, an array length of 1 is returned.
Remarks
Sends a NotifyIntentToMove message before the operation.
Sends a NotifyRecordChange message upon completion.
The Average() method allows several averages to be calculated in one pass through the database. On successful completion, the current record will be the last file record and EOF will be TRUE.
See Also