Returning fully qualified name of an object (longname())¶
longname() |
Return fully qualified name of an object |
SYNTAX
longname(object_id)
Returns the long name of the object referred to by object_id - that is, the fully qualified name, including not only the object’s identifier but also, the window, group, menu, as appropriate.
This function is useful in the following circumstances:
1 |
When object_id is an argument passed to a function. See Example 1 below. |
2 |
When object_id is a pointer-type temporary field. The function can be used to retrieve the full name of the object to which the pointer is pointing. See Example 2 below. |
This function returns an alphanumeric type.
NOTES
The nameof() function returns an object’s short name - its identifier alone, without qualifiers.
EXAMPLE
Retrieve argument passed to a function. This example displays the caption “Win1.Button2”:
+window Win1 at 100,80 { +button Button2 at 14,5 { label = "BUTTON2" } } NameButton(Button2) ... !function NameButton(b) { caption longname(b) }
Retrieve the object pointed to. The temporary field tmp.Alpha30 now contains “Win3.Meals.Lunchbox”:
!temp Pointer,,p !temp Alpha30,,a30 +window Win3 at 17,8 { textbox group Meals { +textbox LunchBox at 4,4 { ... } } } tmp.Pointer = &LunchBox tmp.Alpha30 = longname(tmp.Pointer)
RELATED TOPICS |