Hello All

I need to introduce some sort of error handelling
and have the code for one of the classes. I have verified that 
this works correct. My question is : is there any better way
to handle it in a larger scale?


CREATE CLASS QCheckBox INHERIT QAbstractButton

   VAR     pPtr

   METHOD  new()
   METHOD  configure( xObject )

   METHOD  checkState()
   METHOD  isTristate()
   METHOD  setCheckState( nState )
   METHOD  setTristate( lY )

   ERROR HANDLER onError()

   ENDCLASS

/*----------------------------------------------------------------------*/

METHOD QCheckBox:new( ... )
   LOCAL p
   FOR EACH p IN { ... }
      p := hbqt_ptr( p )
      hb_pvalue( p:__enumIndex(), p )
   NEXT
   ::pPtr := Qt_QCheckBox( ... )
   RETURN Self

METHOD QCheckBox:onError()
   LOCAL cMsg := __GetMessage()
   IF SubStr( cMsg, 1, 1 ) == "_"
      cMsg := SubStr( cMsg, 2 )
   ENDIF
   // TODO: generate runtime error
   hbqt_messageBox( cMsg, "Message not found - " + ProcName( 1 ) + ":" +
hb_ntos( ProcLine( 1 ) ) )
   RETURN cMsg


At least the code above let the developer know 
if he has made any mistakes in message passing than to see
application just vanishing.

Regards
Pritpal Bedi
-- 
View this message in context: 
http://old.nabble.com/HBQT---Class-Error-Handelling-tp26882195p26882195.html
Sent from the Harbour - Dev 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