A complement test, about the powerfull feature on HMG Extended when use any variable.
CLASS ObjFromStack
VAR aStack INIT {}
METHOD New( ... )
METHOD Center() INLINE DoMethod( hb_ArrayToParams( ::aStack ), "Center")
METHOD Activate() INLINE DoMethod( hb_ArrayToParams( ::aStack ), "Activate")
METHOD Value( xValue )
ENDCLASS
METHOD New( ... ) CLASS ObjFromStack
::aStack := hb_AParams()
RETURN Self
METHOD Value( xValue ) CLASS ObjFromStack
IF xValue != Nil
SetProperty( hb_ArrayToParams( ::aStack ), "Value", xValue )
ELSE
xValue := GetProperty( hb_ArrayToParams( ::aStack ), "Value" )
ENDIF
RETURN xValue
On same sample:
oDlg := ObjFromStack():new( xDlg )
oDlg:Center()
oDlg:Activate()
...
IF ! Empty( oDay )
oCheck := ObjFromStack():New( xDlg, oDay )
IF oCheck:Value
cTxt += Dtoc( Stod( "2025" + StrZero( oMonth:__EnumIndex(), 2 ) + StrZero( oDay:__EnumIndex(), 2 ) ) ) + " "
ENDIF
ENDIF
Note:
the Empty() is needed, because there are 31 days on array, but not all months have 31 days
It is only a test, we do not need OOP all time
José M. C. Quintas