FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How free Class Dymanic
Posts: 225
Joined: Tue Feb 28, 2006 04:25 PM
How free Class Dymanic
Posted: Thu Jun 12, 2008 12:08 AM

Friends

Have function for create DATAfields

function TMyMSQuery( cCls ) ; return( MyGenClass( cCls, TMSQuery() ) )

The variable __aHCls
AAdd( __aHCls, { cClsName, __nClassH } )

the class and handle
How free

static __aHCls := {}

include "HbClass.ch"

//---------------------------------------------------------------------------//
// Generador de clases dinamicas

function MyGenClass( cClsName, FromClass )

local n, __nClassH, __odB
local cFromClass := upper( FromClass:ClassName() )

cClsName := "TMY" + Upper( if( empty( cClsName ), ;
            PadL( len( __aHCls ), 7, "0" ), Alltrim( cClsName ) ) )

if ( n := AScan( __aHCls, { |aClass| aClass[ 1 ] == cClsName } ) ) == 0
    _HB_CLASS cClsName
    __oDb := HBClass():New( cClsName, { cFromClass } )
    __oDb:Create()
    __nClassH := __oDb:hClass
    AAdd( __aHCls, { cClsName, __nClassH } )
else
    __nClassH := __aHCls[ n, 2 ]
endif

return( __clsInst( __nClassH ) )

//Cretae the function for deleted __aHCls the handling
//the class

Function CloseClass( oClase )
Local n,cClsName

cClsName := "TMY" + Upper( PadL( len( __aHCls ), 7, "0" )  )

if ( n := AScan( __aHCls, { |aClass| aClass[ 1 ] == cClsName } ) ) == 0
   // ya se creo la clase
else
     __aHCls[ n, 1 ]:=NIL
     __aHCls[ n, 2 ]:=NIL
     ADEL( __aHCls , n )

endif
oClase:=NIL

return( cClsName )

ME INTERESA FW Y XHB POR SER OPEN SOURCE
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
How free Class Dymanic
Posted: Thu Jun 12, 2008 06:55 AM

Vladimir,

As far as I know, there is no a way to delete a Class yet.

It could be done, but its not available yet.

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion