Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to destroy an index in òðàíçàêöèè? An example.
Message
From
15/02/1999 14:49:38
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
How to destroy an index in òðàíçàêöèè? An example.
Miscellaneous
Thread ID:
00187774
Message ID:
00187774
Views:
53
Hi,All.

It can to somebody will help.
It is real only at concurrence all of five conditions.
But this effect is shown both in VFP3 and in VFP5 and in VFP6 and any of Service Pack him does not correct.
SP to VS6 does not mention at bugs VFP6.
This of BUG MS is very hardy.

This example only demonstration of a BUG.

CLOSE database
SET safe off
CREA database d
CREATE table a (key c(3) primary key)&&To create the table with an index
FOR i=300 to 310
INSERT into a (key) values (str(i,3)) && To fill in the table
ENDFOR
nn=recc() && remember amount of records
USE
new_rec='999'
form1=createobject('form1') && with a flag readonly
form2=createobject('form2') && add new record
Release form1,form2 && the forms can be closed
***CHECK of RECORD
USE a excl &&
if recc()>nn && There is a new record
go bott
wait wind 'The new record is found | '+key nowait
SET order to key && Search on an index
IF !seek(new_rec) && By the way, the record is not visible and by search LOCATE
=messagebox('The index has failed')
set order to
brow nowait
if messagebox('REINDEX ?',4)=6
&& It does not change index expression, the filter and does not add record
reindex && To restore an index.
set order to key
IF !seek(new_rec)
=messagebox('The record is not found')
else
=messagebox('Now record is found!!!!!!!!') && However, the record occurs
endif
endif
ENDIF
endif
RETURN

DEFINE class form1 as form && FORM 1
DataSession=2 && PRIVATE
Name='READONLY'
PROCEDURE init
USE a noupdate && READONLY!!!
ENDPROC
ENDDEFINE && These definitions in the form 1 - SUFFICES!

DEFINE class form2 as form
DataSession=2
Name='WRITE'
PROCEDURE init
USE a
SET multi on
CursorSetProp('buffering',5,'a')
INSERT into a (key) values (new_rec) && new record
BEGIN transaction
ff=tableupdate(.T.,.T.,'a')&& update
IF ff && ready ?
END transaction
WAIT wind 'Normal end of a Transaction'
ELSE
ROLLBACK
=messagebox('ERROR')
ENDIF
ENDPROC
ENDDEFINE
Next
Reply
Map
View

Click here to load this message in the networking platform