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
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

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)