This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v20 R7
Current form table
|
Current form table -> Function result | ||||||||
Parameter | Type | Description | ||||||
Function result | Pointer |
![]() |
Pointer to the table of the currently displayed form | |||||
The Current form table command returns the pointer to the table of the form being displayed or printed in the current process.
The function returns Is nil pointer in the following cases:
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:
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 code=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
Product: 4D
Theme: Table
Number:
627
Modified: 4D v11 SQL
4D Language Reference ( 4D v20 R7)