Listbox: get current object name

Click onto the header or the column of a listbox and get its object name.

https://forums.4d.com/4DBB_Main/x_User/3906/files/28134665.zip

<code 4D>
// Method LB_Get_Current_nameObject returns an onbject name from the listox
//
// #SYNTAX: $L_Erreur:=LB_Get_Current_nameObject
// #PARAMETERS:
// $0 Text : object name

// #DATE CREATION: 17/01/2019 #AUTHOR: Bertrand SOUBEYRAND info@soubeyrand-4d-developer.eu
// #DATE MODIFICATION: 00/00/0000
// #NOTE:
// This method can be call from within the current listbox object method
// #HEADER VERSION: 2

// After a clic onto a column or header
// we want to know the name of the object

C_TEXT($0)
$0:=""

ARRAY TEXT($rT_LB_Names;0)
LISTBOX GET OBJECTS(*;OBJECT Get name(Object with focus);$rT_LB_Names)

C_LONGINT($i;$L_Size)
$i:=1
$L_Size:=Size of array($rT_LB_Names)

C_TEXT($T_Name)
$T_Name:=""

While (Length($T_Name)=0) & ($i<=$L_Size)

If ((OBJECT Get pointer(Object named;$rT_LB_Names{$i}))=Self)
	$T_Name:=$rT_LB_Names{$i}
End if 
$i:=$i+1

End while

$0:=$T_Name

// EOM
</code 4D>