Information générale
Titre:
How 'to lose' the table? An example.
Hi,All.
I bring one more demonstration example bug. In it the form loses number DataSession.
This example works in VFP3-6 with established SP.
Probably it will be interesting.
CLOSE database
SET safe off
CREATE table a (key c(3)) && To create the table
use
form1=createobject('form1')
DEFINE class form1 as form
DataSession=2 && PRIVATE
PROCEDURE init
USE a
=messagebox('Table A is open',64,'Begining of FOCUS')
_VFP.DOCMD('!rem') && The command RUN without DOCMD will work correctly
if sele('a')=0 && The table was gone?
=messagebox('Table A not found.Let's search',64,'FOCUS')
if set('datasession')#thisform.datasessionid
=messagebox('DATASESSION has changed!!! We try to restore.',64,'FOCUS')
ff=thisform.datasessionid && We remember necessary datasession
thisform.datasessionid=ff && It is logical, but does not work
thisform.datasessionid=1 && We begin at first
thisform.datasessionid=ff && Here now just right
if sele('a')#0
=messagebox('The table is found',64,'The end of focus')
sele a
use
delete file a.dbf
endif
endif
endif
ENDPROC
ENDDEFINE
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement