Current form table

4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next

version 6.0


Current form table Pointer

ParameterTypeDescription
This command does not require any parameters
Function resultPointerPointer to the table of the currently displayed form

Description

The Current form table command returns the pointer to the table of the form being displayed or printed in the current process.

If there is no form being displayed or printed in the current process, the command returns Nil.

If there are several windows open for the current process (which means that the window opened last is the current active window), the command returns the pointer to the table of the form displayed in the active window.

If the currently displayed form is the Detail form for a subform area, you are in data entry and you double-clicked on a record or a subrecord of a double-clickable subform area. In this case, the command returns:

The pointer to the table shown in the subform area, if the subform displays a table.

A non-significant pointer, if the subform area displays a subtable.

Example

Throughout your application, you use the following convention when displaying a record:

If the variable vsCurrentRecord is present in a form, it displays "New Record" if you are working with a new record. If you are working with the 56th record of a selection composed of 5200 records, it displays "56 of 5200".

To do so, use the object method to create the variable vsCurrentRecord, then copy and paste it into all of your forms:

      ` vsCurrentRecord non-enterable variable object method
   Case of
      : (Form event =On Load)
         C_STRING (31;vsCurrentRecord)
         C_POINTER ($vpParentTable)
         C_LONGINT ($vlRecordNum)
         $vpParentTable:=Current form table
         $vlRecordNum:=Record number ($vpParentTable->)
         Case of
            : ($vlRecordNum=-3)
               vsCurrentRecord:="New Record"
            : ($vlRecordNum=-1)
               vsCurrentRecord:="No Record"
            : ($vlRecordNum>=0)
               vsCurrentRecord:=String (Selected record number ($vpParentTable->))+" of "+
                                          String (Records in selection ($vpParentTable->))
         End case
   End case

See Also

DIALOG, INPUT FORM, OUTPUT FORM, PRINT SELECTION.


4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next