FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Como se Clona un Objeto
Posts: 1078
Joined: Thu Sep 27, 2007 03:47 PM
Como se Clona un Objeto
Posted: Thu Apr 11, 2013 04:59 PM

Saludos al forum

Como se clona un Objeto.

Ruben Dario Gonzalez
Cali-Colombia
rubendariogd@hotmail.com - rubendariogd@gmail.com
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Como se Clona un Objeto
Posted: Thu Apr 11, 2013 05:06 PM

oNew := oClone( oObject )

Salu2

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 1078
Joined: Thu Sep 27, 2007 03:47 PM
Re: Como se Clona un Objeto
Posted: Thu Apr 11, 2013 07:50 PM

Gracias karinha

Me da este error al ejecutar

__objcole -- Error de Argumento

Ruben Dario Gonzalez
Cali-Colombia
rubendariogd@hotmail.com - rubendariogd@gmail.com
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Como se Clona un Objeto
Posted: Thu Apr 11, 2013 08:26 PM

Que intentas clonar, una ListBox?

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 1078
Joined: Thu Sep 27, 2007 03:47 PM
Re: Como se Clona un Objeto
Posted: Thu Apr 11, 2013 08:32 PM

No
No se si es posible clonar esto
oQSet := TOleAuto():New( "ADODB.Recordset" )
...
oQSet:Open( "Select "+ cSelect +" from " + cTabla + " LIMIT 50" , oApp:StrConnection,1, 3 )

Intento clonar el oQSet no se si es posible,

Ruben Dario Gonzalez
Cali-Colombia
rubendariogd@hotmail.com - rubendariogd@gmail.com
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Como se Clona un Objeto
Posted: Thu Apr 11, 2013 08:45 PM

ni jo.
mis desculpas.

salu2

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Como se Clona un Objeto
Posted: Thu Apr 11, 2013 09:22 PM

Ruben,

Clonar un objeto que use determinados handles de Windows, memoria, buffers, etc., no tiene sentido. El resultado no serviría de nada, ó provocaría muchos errores.

Lo que puedes hacer es copiar los valores de las datas del objeto, pero el objeto en si, completo, no podria ser duplicado y uno provocaria errores en el otro.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Como se Clona un Objeto
Posted: Fri Apr 12, 2013 01:20 PM
ruben Dario wrote:No
No se si es posible clonar esto
oQSet := TOleAuto():New( "ADODB.Recordset" )
...
oQSet:Open( "Select "+ cSelect +" from " + cTabla + " LIMIT 50" , oApp:StrConnection,1, 3 )

Intento clonar el oQSet no se si es posible,

RecordSet has a Clone method in ADO.

oRs2 := oRs:Clone()

oRs2 has all the filter, sort, record position at the time of cloning.
For all subsequent operations, the two recordsets are in independent.
Regards



G. N. Rao.

Hyderabad, India
Posts: 1078
Joined: Thu Sep 27, 2007 03:47 PM
Re: Como se Clona un Objeto
Posted: Fri Apr 12, 2013 03:38 PM

Muchas Gracias

Por su aporte y alcaracion

Ruben Dario Gonzalez
Cali-Colombia
rubendariogd@hotmail.com - rubendariogd@gmail.com
Posts: 838
Joined: Wed Aug 22, 2007 10:09 AM
Re: Como se Clona un Objeto
Posted: Wed Apr 08, 2020 02:40 PM

No, it is not.

When you clone a Recordset you actually just create a new pointer to the same Recordset, therefore any changes you make to one Recordset will be visible in all of its clones. However, if you execute a Requery on the original Recordset, the clones will no longer be synchronized to the original.

The provider must support bookmarks on the Recordset object to create clones. Bookmarks are interchangeable; a bookmark reference from one Recordset object refers to the same record in any of its clones.

Note: The filter of the original Recordset will not be applied to the clone. To copy an existing filter: objRecordsetNew.Filter=objRecordsetOriginal.Filter

Saludos / Regards,



FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40

Continue the discussion