This seems to be a really advantageous way to use objects. It compiles and
returns good results. I can see where caution would be advised, but is using
an object this way going to break eventually as the 4D language matures, or is
it an advantage of objects?
// ----------------------------------------------------
// Method: test_Calc
// INPUT1: Object
C_OBJECT($obj;$1)
$obj:=$1
$obj.val:=$obj.val*3
// -----------------------------------
// Method: Some_Method
C_OBJECT($obj)
If (Shift down)
$obj:=New object("val";"ward_a") // Alert displays "ward_award_award_a"
Else
$obj:=New object("val";30) // Alert displays 90
End if
test_Calc ($obj)
ALERT(String($obj.val))
//-------------------
// this would not compile
// If (Shift down)
// $v:="ward_a"
// Else
// $v:=30
// End if
Thanks - Keith - CDI
**********************************************************************
4D Internet Users Group (4D iNUG)
Archive: http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:[email protected]
**********************************************************************