FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour CLASS Information needed?
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
CLASS Information needed?
Posted: Thu Sep 03, 2009 10:24 AM
Hi,

I try to learn how to write class. I examined the TDatabase class. I just want to find out the which method is done this.

FWH Example : dbf01.prg
Line 73:
Code (fw): Select all Collapse
   REDEFINE GET oDbf:First ID ID_NAME OF oDlg UPDATE ;
      MESSAGE "Please type here the first name of the customer"

                                              // We directly use the Fields
                                              // name, but we are working on
                                              // a buffer ! This is perfect
                                              // for Network management


We use the fields directly oDbf:<Fieldname>. How? Which method is used to do this?

Thanks,
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: CLASS Information needed?
Posted: Thu Sep 03, 2009 10:41 AM
Hakan,

We use the Classes ON ERROR feature:
Code (fw): Select all Collapse
   #ifdef __HARBOUR__
      ERROR HANDLER OnError( uParam1 )
   #else
      ERROR HANDLER OnError( cMsg, nError )
   #endif

...
Code (fw): Select all Collapse
#ifdef __HARBOUR__
   METHOD OnError( uParam1 ) CLASS TDataBase
      local cMsg   := __GetMessage()
      local nError := If( SubStr( cMsg, 1, 1 ) == "_", 1005, 1004 )
#else
   METHOD OnError( cMsg, nError ) CLASS TDataBase
      local uParam1 := GetParam( 1, 1 )
#endif
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: CLASS Information needed?
Posted: Thu Sep 03, 2009 11:19 AM

Thanks Antonio,

I have looked at the TDatabase class several times. I could not imagine it in ERROR HANDLER. :D

Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: CLASS Information needed?
Posted: Thu Sep 03, 2009 11:51 AM
Hakan,

Have you read the articles I wrote on writing classes that are on my website?

http://www.gointellitech.com

James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: CLASS Information needed?
Posted: Thu Sep 03, 2009 12:23 PM

Yes, James.

Your webpage about classes is my first learning stage.

Thank you again.

Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06

Continue the discussion