Hi Mauricio.
IMHO, not strange. Please don't confuse LOCAL object with HMG4 (internal) object.
In OOP style you can write:
Code: Select all
WITH OBJECT objectClass():New() * HMG4 (internally) create this reference "HMG_OBJECT_1" that is an object
WITH OBJECT objectClass():New("MyReference") *HMG4 (internally) use this reference and is an object
(ie if it's a textbox you can use MyForm:HMG_OBJECT_1:Value or MyForm:MyReference:Value)
but these are not "local object" inside your application program. With HMG3 (not about Window) is ( +- ) the same and a foundamental was "keep the HMG3 compatibility".
In other words
DEFINE TEXTBOX MyTextbox doesn't create a "local object" but an internal HMG3 "object" and you can use "MyTextBox" as a reference.
But now we can have (or we can use) a REAL local "object" reference in this way
Code: Select all
WITH OBJECT oMyLocal := objectClass():New() HMG4 (internally) create this reference "HMG_OBJECT_1" that is an object
WITH OBJECT oMyLocal := objectClass():New("MyReference") HMG4 (internally) use this reference and is an object
oMyLocal is the local "container....pointer....". Take a look to the first letter: "o", it means (give me a cent) object.
With previous translation commands was mandatory to code LOCAL oMyLocal, but in this way there wasn't a backward HMG3 compatibility, because DEFINE TEXTBOX MyTextBox must be translated into
Code: Select all
LOCAL MyTextBox
WITH OBJECT MyTextbox
.....
END WITH
that is very different from HMG3
To solve this, I've introduced the "TOVAR" option. In this way we can preserve HMG3 compatibility (see commands), we can use a reference (ie MyTextBox) to get/set an object (ie MyForm:MyReference) and extend OOP usage with local object.
You can compare some HMG3 demo and some HMG4 demo (arranged): they are (about) the same.
Cheers