both harbor and xharbour allow the modification of methods and datas of a class.
examples:
Code: Select all
/*-------------------------------------------------------------------------------------------------*/
#include "hbclass.ch"
/*-------------------------------------------------------------------------------------------------*/
PROCEDURE OverrideAndExtend()
EXTEND CLASS TCONTROL WITH METHOD MyDisable
...
...
OVERRIDE METHOD GETDLGCODE IN CLASS TBUTTON WITH KGETDLGCODE
RETURN
/*-------------------------------------------------------------------------------------------------*/
FUNCTION MyDisable( aCtrlType )
LOCAL Self := hb_QSelf()
IF ( ::ClassName() IN aCtrlType )
::bWhen := NIL
::Disable()
ENDIF
RETURN NIL
/*-------------------------------------------------------------------------------------------------*/
FUNCTION KGetDlgCode( nLastKey )
LOCAL Self := hb_QSelf()
::oWnd:nLastKey := nLastKey
DO CASE
CASE !hb_isNil( ::oWnd:oWnd ) .and. ( ::oWnd:oWnd:IsKindOf( "TFOLDER" ) .or. ::oWnd:oWnd:IsKindOf( "TFOLDEREX" ) )
RETURN DLGC_WANTALLKEYS
CASE nLastKey == VK_ESCAPE .and. !hb_isNil( ::oWnd:oWnd ) .and. ( ::oWnd:oWnd:IsKindOf( "TWINDOW" ) .and. ::oWnd:IsKindOf( "TDIALOG" ) )
RETURN DLGC_WANTALLKEYS
ENDCASE
RETURN NIL
for example for add the method lastrec
Code: Select all
...
EXTEND CLASS FWMARIACONNECTION WITH METHOD lastrec
...
FUNCTION Lastrec()
LOCAL Self := hb_QSelf()
RETURN ::RecCount
..
This is an example, I don't remember the name of the native class for mariadb or mysql handling in fivewin.
note:
reviewing the info of fivewin I see that lastrec exists, so I see in the error the variable oQry has a value of nil, so it means that the query failed
oQry := oServer:Query( "CHECK TABLE customer" )
if !hb_nil(oQry)
? oQry:lastrec(), oQry:msg_type, oQry:msg_text
oQry:end()
else
?"Error in query."
endif
You can verify the name of the table, remember that if your server is linux, it is most likely that the names of tables and fields are case sensitive.