Before selection

4D - Documentation   Français   English   German   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next

version 3


Before selection {(table)} Boolean

ParameterTypeDescription
tableTableTable for which to test if record pointer
is before the first selected record, or
Default table, if omitted
Function resultBooleanYes (TRUE) or No (FALSE)

Description

Before selection returns TRUE when the current record pointer is before the first record of the current selection of table. Before selection is commonly used to check whether or not PREVIOUS RECORD has moved the current record pointer before the first record. If the current selection is empty, Before selection returns TRUE.

To move the current record pointer back into the selection, use LAST RECORD, FIRST RECORD, or GOTO SELECTED RECORD. NEXT RECORD does not move the pointer back into the selection.

Before selection also returns TRUE in the first header when a report is being printed with PRINT SELECTION or from the Print menu. You can use the following code to test for the first header and print a special header for the first page:

      ` Method of a form being used as output form for a summary report
   $vpFormTable:=Current form table
   Case of
         ` ...
      : (Form event=On Header)
            ` A header area is about to be printed
         Case of
            : (Before selection($vpFormTable->))
               ` Code for the first break header goes here
               ` ...
         End case
   End case

Example

This form method is used during the printing of a report. It sets a variable, vTitle, to print in the Header area on the first page:

      ` [Finances];"Summary" Form Method
   Case of
         ` ...
      : (Form event=On Header)
         Case of
            : (Before selection([Finances))
               vTitle := "Corporate Report 1997"  ` Set the title for the first page
            Else
               vTitle := ""  ` Clear the title for all other pages 
         End case
   End case

See Also

End selection, FIRST RECORD, Form event, PREVIOUS RECORD, PRINT SELECTION.


4D - Documentation   Français   English   German   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next