How ADD DATA in CLASS

How ADD DATA in CLASS

Postby mauricioajordao » Tue Feb 28, 2006 11:11 pm

Hi Friends ,

How ADD DATA In CLass ?


CLASS TESTE
DATA XXXX -> ADD class in CREATE class.
METHOD NEW(X,Y)
ENDCLASS

METHOD new(x,Y) CLASS TESTE

*** HOW ADD DATA THIS CLASS IS HERE ****


rETURN(NIL)


thanks
mauricioajordao
 
Posts: 78
Joined: Fri Dec 02, 2005 6:55 pm
Location: brazil

Postby Antonio Linares » Wed Mar 01, 2006 7:29 am

Mauricio,

Code: Select all  Expand view  RUN
...
#include "hboo.ch"

METHOD new(x,Y) CLASS TESTE

   static lAdded := .f.

   ASize( Self, Len( Self ) + 1 )  // add one more element for the new DATA

   if ! lAdded
      __clsAddMsg( ::ClassH, "Another", Len( Self ), HB_OO_MSG_DATA )
      __clsAddMsg( ::ClassH, "_" + "Another", Len( Self ),  HB_OO_MSG_DATA )
      lAdded = .t.
   endif

   ...

return Self
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42111
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby mauricioajordao » Wed Mar 01, 2006 9:49 am

Than you , Antonio...



Mauricio
(Brasil)
mauricioajordao
 
Posts: 78
Joined: Fri Dec 02, 2005 6:55 pm
Location: brazil


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 88 guests