A problem with TDatabase using copy() / Past() ?
Posted: Thu Jan 31, 2019 12:33 pm
Hello,
I noticed a problem using tDatabase Copy() / Paste(aVals)
Wihout selected fields, record 9 is copied to 10
METHOD Copy()
METHOD Paste( aVals )
using Paste() without aVals works
adding aVals doesn't work
maybe something wrong with paste()
regards
Uwe
I noticed a problem using tDatabase Copy() / Paste(aVals)
Wihout selected fields, record 9 is copied to 10
METHOD Copy()
METHOD Paste( aVals )
using Paste() without aVals works
adding aVals doesn't work
- Code: Select all Expand view
FUNCTION NET_COPY4 ( nStart, nEnd, lFields )
Local lReturn := .T., aVals := { oCust:Last, oCust:First }
IF nStart = nEnd
lReturn := .F.
MsgAlert( "nStart = nEnd" + CRLF + ;
"Not possible, to copy Record + ALLTRIM(STR(nRecord)) !", "ERROR")
RETURN lReturn
ENDIF
oCust:Copy() // copy fields of selected record
IF nEnd > 0 // no append
oCust:KeyGoTo( nEnd ) // go to defined record
ELSE
oCust:Append()
ENDIF
oCust:Lock()
IF lFields = .T. // using selected fields
oCust:Paste(aVals) // doesn't work !
ELSE
oCust:Paste() // works
ENDIF
oCust:SAVE()
oCust:Commit()
oCust:UnLock()
RETURN lReturn
maybe something wrong with paste()
regards
Uwe