Hello

Just to be sure that I am doing right at the start
here is the code I am employing with methods and 
instance variables with the same name.

Please guide me if there is better and efficient way to 
accomplish the same.


CLASS WvgWindow 

   DATA lbClick 
    
   METHOD Init() 
   METHOD lbClick   SETGET

   ENDCLASS 

METHOD init() CLASS WvgWindow 
   RETURN SELF 

METHOD lbClick( xParam ) CLASS WvgCrt

   if hb_isNil( xParam ) .or. hb_isBlock( xParam )
      ::sl_lbClick := xParam
      RETURN NIL
   endif

   if hb_isArray( xParam ) .and. hb_isBlock( ::sl_lbClick )
      eval( ::sl_lbClick, xParam, NIL, Self )
   endif

   RETURN Self


As this way suggests that there will ever be parameter checking
when either executing or assigning, will not it affects the overall
performance given the fact that such code will be executed 
hundreds of time within short span of program execution.
This is only one method, there are more than a dozens like that.

All the help is appreciated.

Regards
Pritpal Bedi


-- 
View this message in context: 
http://www.nabble.com/Classes%3A-Methods-and-Instance-Variables-with-SAME-Name-tp20354744p20408479.html
Sent from the Harbour - Dev mailing list archive at Nabble.com.

_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to