Current form name
Current form name -> Function result
Parameter | Type | Description | |
---|---|---|---|
Function result | Text | ← | Name of current project form or current table form in the process |
This command is not thread-safe, it cannot be used in preemptive code.
Description
The Current form name command returns the name of the current form defined for the process. The current form can be a project form or a table form.
By default, if you have not called the FORM LOAD command in the current process, the current form is the one being displayed or printed. If you have called the FORM LOAD command in the process, the current form is the one set by this command and it remains so until you call FORM UNLOAD (or CLOSE PRINTING JOB).
The command returns:
- the form name, or
- the filename without the extension if the current form is created by a .json file, or
- the "name" attribute if the current form is created by an object, or
- an empty string if there is no current form defined for the process.
Example 1
In an input form, place the following code in a button:
var $FormName : Text
$win:=Open form window([Members];"Input";Plain form window)
DIALOG([Members];"Input")
$FormName:=Current form name
// $FormName = "Input"
FORM LOAD([Members];"Drag")
$FormName:=Current form name
// $FormName = "Drag"
//...
Example 2
You want to get the current form if it is a project form:
$PointerTable:=Current form table
If(Nil($PointerTable)) // this is a project form
$FormName:=Current form name
... // processing
End if