version 1.5
OP Records in selection (connectionID; tableID; recordsInSelection) Longint
Parameter | Type | Description | |
connectionID | Longint | Connection ID with target server | |
tableID | Longint | Table ID in the database | |
recordsInSelection | Longint | Number of records in target table current selection | |
Function result | Longint | Error code result for the function |
Description
OP Records in selection returns the number of records in the current selection of tableID in the recordsInSelection variable.
Error Codes
If OP Records in selection executes successfully, it returns 0. Otherwise, this function returns one of the following errors:
Error Code | Description |
-9972 | Table number is out of range. |
10128 | The 4D Open for 4th Dimension package has not been initialized. |
10136 | The connection does not exist. |
10154 | This command cannot be executed right now. |
Example
C_LONGINT (vTableID;vFieldID) C_LONGINT (vRecords) C_LONGINT ($errCode;$nbHours) UserSelectInvoices `Display a dialog that lets the user specify criteria UserQueryRun ` Perform the query specified by the user ` Get number of records in the table $errCode:=OP Records in selection (vConnectID;2;vRecords) ` Compute average time to process user selection $nbHours:=vRecords*<>avgTimePerRecord If ($nbHours > 8) ` If more than eight hours to process, get user's OK CONFIRM ("This operation will take more than eight hours"+Char (13)+ "Proceed ?") If (OK=1) processInvoices End if End if
See Also
OP All records, OP Multi query, OP Records in table, OP Single query, OP Use named selection, Records in selection.