Explicação SET SCOPE ir para EOF do DBF eficazmente.
Enviado: 04 Set 2015 08:31
Ola!
Boa explicação do Przmek.
Sempre usei gobottom + skip
Saudações,
Itamar M. Lins Jr.
Boa explicação do Przmek.
Esse "DBGOTO( 0 )" para posicionar o ponteiro no EOF eu não sabia.Hi,
SET SCOPE does not allow to access record with out of cope values
if only dbGoTop()/dbGoBotom()/dbSkip()/dbSeek() functions are
used. dbGoTo() can still be used to access records which does not
meet scope condition.
Harbour core code does not use dbGoTo() function so it cannot
show in browser. The problem you described can appear only if
user uses [db]goto() to chose recode out of scope and then
force refreshing, i.e. to access phantom record (EOF) such code
wrongly uses:
dbGoTo( lastRec() + 1 )
instead of:
dbGoTo( 0 )
The first version creates race condition so it's possible that
new record is added between lastRec() and dbGoTo() and this
record is accessed. The second one is correct method to access
phantom (EOF) record and always works.
best regards,
Przemek
Sempre usei gobottom + skip
Saudações,
Itamar M. Lins Jr.