Tech Tip: Obtaining the name of an active form
PRODUCT: 4D | VERSION: | PLATFORM: Mac & Win
Published On: May 30, 2002
Compatibility: 6.5.x , 6.7.x, and 6.8.x
The following simple procedure allows you to obtain the name of the current active form. The basic idea is to force the form method to be executed. You can do this by executing the command SET TIMER in an object or a project method.
SET TIMER(1) ` Timer is set to 1 tick
This statement will immediately trigger the On Timer form event.
Here is form method that will be executed once the On Timer form event is triggered.
If (Form event=On Timer)
C_TEXT($FormMethod;vFormName)
C_LONGINT($Position)
$FormMethod:=Current method name
$Position:=Position(".";$FormMethod)
vFormName:=Substring($FormMethod;$Position+1)
SET TIMER(0)
End if