KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Obtaining the Variable Name of the Current Active Object
PRODUCT: 4D | VERSION: 2003.3 | PLATFORM: Mac & Win
Published On: June 24, 2004

Version: 6.8.x and 2003.x

Here is a simple method that will return the name of the current field or variable object as the function result.

` Project Method: GetName
C_POINTER($1)
C_TEXT($0;$varname)
C_LONGINT($tablenum;$fieldnum)
RESOLVE POINTER($1;$varname;$tablenum;$fieldnum)
If ($tablenum#0) & ($fieldnum#0)
    $0:=Field name($tablenum;$fieldnum)
Else
    $0:=$varname
End if

Example method call:

vtName:=GetName(Self)