Hi,
I'm fairly new to VFP and had a question regarding buffering, so I thought I would ask the experts out there. I have a table in a form's DE and have it set to use the forms default buffering. The form is set to 2 - Optimistic buffering. I have a push button on the form that populates the table with data from an array. What method do I use:
Do I use my old FP2.6 code:
SELECT table
FOR nCtr = 1 TO ALEN(Array,1)
IF SEEK(array(nCtr)
IF RLOCK()
REPLACE field1 WITH array(nCtr,1)
REPLACE field2 WITH array(nCtr,2)
UNLOCK
ENDIF
ELSE
APPEND BLANK
REPLACE field1 WITH array(nCtr,1)
REPLACE field2 WITH array(nCtr,2)
UNLOCK
ENDIF
ENDFOR
or.......
Can I use the following:
SELECT table
FOR nCtr = 1 TO ALEN(Array,1)
IF SEEK(array(nCtr)
REPLACE field1 WITH array(nCtr,1)
REPLACE field2 WITH array(nCtr,2)
ELSE
APPEND BLANK
REPLACE field1 WITH array(nCtr,1)
REPLACE field2 WITH array(nCtr,2)
ENDIF
ENDFOR
TABLEUPDATE(.T.)
Also, would using a INSERT-SQL statement be preferable over APPEND BLANK in the above example? Would I still issue a TABLEUPDATE(.T.) at the end if I did?
One more thing, I have seen the following used: TABLEUPDATE(.T.,.T.) In help, I could only find one logical parameter to pass. What are these parameters used for?
TIA for any expert advise!
James Moore