How free Class Dymanic

How free Class Dymanic

Postby Vladimir Zorrilla » 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
Vladimir Zorrilla
 
Posts: 225
Joined: Tue Feb 28, 2006 4:25 pm
Location: PERU

Postby Antonio Linares » Thu Jun 12, 2008 6: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41324
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

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