>> Detecting unused instance variables can be implemented _only_ for HIDDEN
>> ones and only if class if fully implemented in single file without any
>> externally defined methods and/or friend functions so you should not
>> expect it will ever have similar functionality to detecting unused local
>> variables. If we decide to add it then it would be necessary to also add
>> method to mark them as used (just like HB_SYMNBOL_UNUSED() for normal
>> variables) so programmer can pacify false warnings when hidden instance
>> variables are accessed only by methods implemented in different
>> compilation
>> units (files).
>> ...
>> 
> 
> Very well described text. It widened my perspective, thank you.
> 
> If we implement detection of undefined iVar then I think there will be 
> more limitations thans advantages. In hbQT, for certain section, I employ 
> this "lack of feature" effectively and which have saved me a lot of 
> coding.
> 
>   oUI := HbQtUI():new(...)
> 
>   ....
> 
>   oUI:q_buttonClose:setText( "Close" )
> 
> Here "q_buttonClose" is not defined as an iVar in HbQtUI() class.
> It is redirected to ON ERROR method where it is parsed and 
> taken care of.
> 
> Yes, for sure, reporting only of undeclared iVars will be important.

It's rather a question of controlling this feature.

IMO it's no question that we should protect against 
this kind of error, since it's useful for "most" code 
(all code, which doesn't dynamically creates messages 
and doesn't uses ON ERROR tricks to emulate it). If 
some code requires such exception, there should be 
a way to allow it and not throw warnings in this case. 
But not adding it at all because it's not needed in 
some place is IMO a mistake.

Brgds,
Viktor

_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to