That for needed locktable, if this func don't locks table ???
I need to lock some tables, some recs of tables are modified only at the end of code execution.
For undersanding locktable I write following code:
IF CONFIRM('Lock?') THEN
BEGIN
w.OPEN('#1#######');
t17.LOCKTABLE();
i:=10;
REPEAT
SLEEP(1000);
i:=i-1;
w.UPDATE(1,i);
UNTIL i=0;
END;
w.CLOSE;
Running this code on two machines NO ANY STOP ON LOCKTABLE !!!
I use NF 1.30
0
Comments
IF CONFIRM('Lock?') THEN
BEGIN
w.OPEN('#1#######');
t17.LOCKTABLE();
t17.MODIFY;
i:=10;
REPEAT
SLEEP(1000);
i:=i-1;
w.UPDATE(1,i);
UNTIL i=0;
END;
w.CLOSE;
-jp
The table actually is locked after you first read from it.
Modify your code as following and check it up:
<BLOCKQUOTE><font size="1" face="Verdana, Arial">code:</font><HR><pre>
IF CONFIRM('Lock?') THEN
BEGIN
w.OPEN('#1#######');
t17.LOCKTABLE();
t17.FIND('-'); // Insert this line
i:=10;
REPEAT
SLEEP(1000);
i:=i-1;
w.UPDATE(1,i);
UNTIL i=0;
w.CLOSE;
END;
</pre><HR></BLOCKQUOTE>
Best regards,
Otto Dreyer
NRG Ltd.
[This message has been edited by Otto Dreyer (edited 23-03-2000).]