CLASS Information needed?

CLASS Information needed?

Postby Horizon » 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: Select all  Expand view
  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.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Re: CLASS Information needed?

Postby Antonio Linares » Thu Sep 03, 2009 10:41 am

Hakan,

We use the Classes ON ERROR feature:
Code: Select all  Expand view

   #ifdef __HARBOUR__
      ERROR HANDLER OnError( uParam1 )
   #else
      ERROR HANDLER OnError( cMsg, nError )
   #endif
 

...
Code: Select all  Expand view

#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
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: CLASS Information needed?

Postby Horizon » 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.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Re: CLASS Information needed?

Postby James Bott » 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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: CLASS Information needed?

Postby Horizon » 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.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 85 guests