Página 1 de 1

TMemDataSet error

Publicado: Mar May 17, 2016 9:53 pm
por ftwein
If you sort a TMemDataSet, edit a record and then cancel the operation, the previous/next record is updated and not the actual.
Please use the project attached. Edit the column "Produto" and press ESC to cancel and you can see the error.
Thanks.
Fausto Di Creddo Trautwein

Re: TMemDataSet error

Publicado: Mié May 18, 2016 11:15 am
por ignacio
Hello,

I hope the problem gets fixed with this new code on module MemRecords.prg method Cancel:

Código: Seleccionar todo

METHOD Cancel() CLASS XMemRecords

	LOCAL nRecno

   IF !::lOnAppend
      nRecno := ::OrgRecno()
      IF Len( ::aData ) >= nRecno .AND. Len( ::aData[ nRecno ] ) >= Len( ::oDataSet:aRecord )
         Aeval( ::oDataset:aRecord, {|v,e| ::aData[ nRecno, e ] := v } )
      ENDIF
   ELSE
      ::lOnAppend := .F.
	ENDIF

RETURN NIL
If you want I can send you also the OBJ and O file.

Any feedback will be highly appreciated.

Regards,

Re: TMemDataSet error

Publicado: Mié May 18, 2016 1:14 pm
por ftwein
It is ok now.

Is it enough to add changed MemRecords.prg to a project ?

Thank you very much.

Re: TMemDataSet error

Publicado: Mié May 18, 2016 1:33 pm
por ignacio
Yes, is enough. Thank you for your feedback.

Regards,