Przemysław Czerpak wrote:
> 
>> one thing I'd like to have is the ability of the compiler to spot iVars
>> like
>> it does variables, I mean unused, not declared and so on, while it now
>> simply
>> ignores all of them and you get an error when executing such code.
> 
> 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.


-----
                 enjoy hbIDEing...
                    Pritpal Bedi 
_a_student_of_software_analysis_&_design_
-- 
View this message in context: 
http://n2.nabble.com/Switch-to-detect-undeclared-vars-being-used-tp4601089p4615729.html
Sent from the harbour-devel mailing list archive at Nabble.com.
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to