OP Average

4D - Documentation   Français   English   German   4D Open for 4D, Command Theme List   4D Open for 4D, Command Alphabetical List   Back   Previous   Next

version 1.5


OP Average (connectionID; tableID; fieldID; result) Longint

ParameterTypeDescription
connectionIDLongintConnection ID with target server
tableIDLongintNumber of the table in the database
fieldIDLongintNumber of the field in the table
resultVariableAverage value in field for the current selection
Function resultLongintError code result for the function

Description

OP Average returns the mean value of all the values for fieldID in the current selection in result. If fieldID is an indexed field, the index is used to compute the mean value (i.e., the response time is shorter).

Error Codes

If OP Average executes successfully, it returns 0. Otherwise, this function returns one of the following errors:

Error CodeDescription
-9969Invalid field type requested (field type is not Longint, Integer, Time or Real).
-9971Field number is out of range.
-9972Table number is out of range.
10128The 4D Open for 4th Dimension package has not been initialized.
10136The connection does not exist.
10154This command cannot be executed right now.

Example

See example for OP Sum.

See Also

OP Max, OP Min, OP Sum.


4D - Documentation   Français   English   German   4D Open for 4D, Command Theme List   4D Open for 4D, Command Alphabetical List   Back   Previous   Next