FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Pregunta sobre CLASES
Posts: 1078
Joined: Thu Sep 27, 2007 03:47 PM
Pregunta sobre CLASES
Posted: Thu Nov 10, 2011 03:50 PM
Buen dia compañeros del Forun

Estoy haciendo una clase. Mi pregunta es la siguiente.
Puedo hacer la Asignacion de DATA asi deacuerdo al codigo adjunto me da error en DATA a


METHOD ASINDATA() CLASS TApp16
Local a,b,i
For i = 1 to oRecordSet[nRecordSet]:Count()
a:="M_"+oRecordSet[nRecordSet]:Fields(i-1):Name
DATA a
Next

RETURN( Self )



Code (fw): Select all Collapse
CLASS TApp16
  DATA oGet, oBtn, aCols3, m1, aArray, aContl, MatValid, regdatos,reggetd   AS ARRAY  
  DATA cSistema, cSystema, cCopyright,cAtencion AS CHARACTER
  DATA oBrw,oSay1,oSay2,oSay3
  DATA g_status
  DATA lExit, x_status, Tierror  AS LOGICAL INIT FALSE
  METHOD NEW()  CONSTRUCTOR
  METHOD OPEN()
  METHOD ASINDATA()
  METHOD CLOSE()
  METHOD LOAD()
  METHOD SAVE()
  METHOD ANULA()
  METHOD END()


ENDCLASS 


METHOD ASINDATA() CLASS TApp16
Local a,b,i
     For i = 1 to oRecordSet[nRecordSet]:Count() 
        a:="M_"+oRecordSet[nRecordSet]:Fields(i-1):Name
        DATA a 
      Next

RETURN( Self )


METHOD New() CLASS TApp16
Local tmenu,t2007,tmepos,taltu,tanch,tpmen,oTipmod
   ::oGet  := { Nil,Nil,Nil,Nil,Nil,Nil,Nil }
   ::oBtn  := { Nil,Nil,Nil,Nil,Nil,Nil,Nil,Nil }
   ::aCols3:= {8}
   ::regdatos:= { Nil,Nil,Nil }
   ::reggetd := { Nil,Nil,Nil }
   ::aArray:= {}
   ::m1    := { Nil,Nil,Nil,Nil,Nil,Nil,Nil,Nil }
 RETURN( Self )
Ruben Dario Gonzalez
Cali-Colombia
rubendariogd@hotmail.com - rubendariogd@gmail.com
Posts: 670
Joined: Wed Oct 19, 2005 06:41 PM
Re: Pregunta sobre CLASES
Posted: Thu Nov 10, 2011 04:36 PM

Compañero pruebe asi

__objAddData( Self, cName )
__objSendMsg( Self, "_" + cName, uValue )

donde cName es el nombre de la data o variable y uValue es el valor inicial y Self es el objeto en si ( perse )

saludos

Wilson 'W' Gamboa A
Wilson.josenet@gmail.com
Posts: 1078
Joined: Thu Sep 27, 2007 03:47 PM
Re: Pregunta sobre CLASES
Posted: Thu Nov 10, 2011 07:48 PM

Gracias Wilson por tu ayuda , Funciono.

Ruben Dario Gonzalez
Cali-Colombia
rubendariogd@hotmail.com - rubendariogd@gmail.com

Continue the discussion