Hi Roberto.
This was introduced, many times ago, when the XBase style command assume that the reference name (ie oBtn_Ok) must be a real variable within end program. This is wrong and a lot of demo must be fixed; now, to have the ability to assign object to a LOCAL/PRIVATE/PUBLIC var, I have extended the old Xbase style command with option TOVAR. In this way we can preserve OLD HMG3 commands and extend this future for HMG4.
This problem was born because there was a little confusion about Xbase style command (ie DEFINE TEXTBOX ReferenceName) and OOP style (ie WITH OBJECT oLocalVar := TEXTBOX():New( "ReferenceName") ).
Where ReferenceName is: a reference (ie MainForm.ReferenceName.Value) and, at the same time, an internal HMG4 object that CAN BE exported to a local var.
So, we can use a OOP style
- WITH OBJECT oLocalVar := TEXTBOX():New("ReferenceName") in this way HMG4 assign RefrenceName as internal name and you can use, in your program, MainForm:ReferenceName:Value
- WITH OBJECT oLocalVar := TEXTBOX():New() in this way HMG4 assign an internal name (ie HMG_OBJECT_1) You can use MainForm:HMG_OBJECT_1:Value but you can't know exactly the name: is an internal creation.
With Xbase style
DEFINE TEXTBOX ReferenceName... in this way HMG4 assign RefrenceName as internal name and you can use, in your program, MainForm:ReferenceName:Value
DEFINE TEXTBOX ReferenceName TOVAR oLocalVar....in this way HMG4 assign RefrenceName as internal name and you can use, in your program, MainForm:ReferenceName:Value BUT you can have oLocalVar within yout end program.
I hope my brief is clear no more technical
Cheers
p.s. for the specific problem, related LOCAL declaration and HB_SYMBOL_UNUSED, must be removed