This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v20.6
Records in selection
|
Records in selection {( aTable )} -> Function result | ||||||||
Parameter | Type | Description | ||||||
aTable | Table |
![]() |
Table for which to return number of selected records, or Default table, if omitted | |||||
Function result | Longint |
![]() |
Records in selection of table | |||||
Records in selection returns the number of records in the current selection of aTable. In contrast, Records in table returns the total number of records in the table.
The following example shows a loop technique commonly used to move through all the records in a selection. The same action can also be accomplished with the APPLY TO SELECTION command:
FIRST RECORD([People]) ` Start at first record in the selection
For($vlRecord;1;Records in selection([People])) ` Loop once for each record
Do Something ` Do something with the record
NEXT RECORD([People]) ` Move to the next record
End for
Product: 4D
Theme: Selection
Number:
76
Created: < 4D v6
4D Language Reference ( 4D v20)
4D Language Reference ( 4D v20.1)
4D Language Reference ( 4D v20.2)
4D Language Reference ( 4D v20.3)
4D Language Reference ( 4D v20.4)
4D Language Reference ( 4D v20.5)
4D Language Reference ( 4D v20.6)