Ok. thanks guys... Let me explain better
My prog in first instance define some gets linked to a database object.
Code: Select all | Expand
redefine get oGet[ 1] var oNomTra:nomtracod id 1001 of oDlg picture '@!' update
After that, there is a button I use to edit the get's trought a function.
Code: Select all | Expand
redefine sbutton oBtn[1] id 1111 of oDlg name "New" nobox update ;
caption "New" text 3 tooltip "New record" ;
action ( NonTraEdit( "NEW", oNomTra, oBtn, oGet, oRadio, oLbx[1], oImg, oWChild) )
In the function there exist the Blank() method to allow the get edition and one routine to validate the user input
Code: Select all | Expand
function NonTraEdit( cModo, oNomTra, oBtn, oGet, oRadio, oLbx, oImg, oWChild )
do case
case cModo $ "NEW,EDIT"
lNew := ( cModo = "NEW" )
if lNew
oNomTra:Blank()
else
if ! oNomTra:RecLock()
lGo := .f.
endif
endif
if lGo
...
The same function is called by another button to validate the gets
Code: Select all | Expand
case cModo = "CHECK"
do case
case Empty( oNomTra:nomtracod )
MsgStop( "The code can't be empty", "Error" )
oGet[1]:SetFocus()
lGo := .f.
case ...
case ...
endcase
...
...
nReg := oNomTra:RecNo()
oNomTra:lBuffer := .f.
oNomTra:Seek( oNomTra:nomtracod )
if oNomTra:Found()
...
lGo := .f.
endif
oNomTra:GoTo(nReg)
oNomTra:lBuffer := .t.
There is where the problem exist. The get initially has the user input value. I want to check if the code there exist in the database file. So, I do a search with the get value, but because the TDatabase Seek() method has a load() method inside makes the original get's value change.
If I try to set to false the object database buffer, this causes that the values are lost.
If I do the search without set the database buffer to false then all get takes the value of the database record. So of any way always I lose the original values