Mike and all others,
Mike said:
Do you need to know the object name from within the code of the form? In other words, you need to reference the object from one of the form's methods? If so, you can do that with THISFORM. You don't need to know the name of the object. In fact, it's better not to, as it makes the code more generic.
Yes this is my case – nearly. I don’t need to know the object name for executing code of that form, but for checking whether the name of this object for future referencing purposes is the same as expected.
Here is the whole story (short story at the end of my post).
There is a form in a project - let's say SomeForm, which is repeatedly called from many places in a project by means of command
Code:
DO FORM SomeForm NAME oSomeName
I think it is preferable way according to this forum (just mentioning thread1252-827297).
Without that, one must make references to form name, which is not in fact name property of a form, but the name under which is form stored on disk – not very nice.
Form SomeForm also needs some child form (ChildForm) where are references to SomeForm (like oSomeName.text1. REFRESH())
After years I was adding some new functionality to this project and by mistake I have forgotten "NAME oSomeName" in DO FORM SomeForm.. command and ChildForm could not resolve the references. Here the question about real name of the form comes into existence.
In fact the biggest problem now is my English. It is behind my potential describe the situation more simply and more clearly.
Nevertheless I understand all your answers and recommendations and I thank you very much for them.
Toman
Modified form of my question:
For referencing purposes one needs the name of an object (here a form)
The name is:
[blue]
SomeForm [/blue] if form is started with "DO FORM [blue]
SomeForm [/blue]" or
[red]
oSomeName [/red] if started with "DO FORM SomeForm NAME [red]
oSomeName [/red]"
How to find the actual name (valid for referencing) from within a form SomeForm.
THISFORM.Name returns always "[blue]
SomeForm[/blue] " and so is not a correct answer.
Please don't waste time with alternative solutions. There are many, I believe. For me is now only important if it is possible to get required object name or not.