home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS - Coast to Coast
/
simteldosarchivecoasttocoast.iso
/
pcmag
/
vol9n18.zip
/
DETECT1.PRG
< prev
next >
Wrap
Text File
|
1990-09-24
|
987b
|
18 lines
? "Duplicate Record Key Checker"
ACCEPT "Enter database name " TO dbn && Input database name.
USE &dbn && Open database.
ACCEPT "Enter field name " TO fld && Input name of field
INDEX ON &fld TO tempndx && Index database on field.
DO WHILE .NOT. EOF() && Search through database.
oldval = &fld && Save field value.
oldrec = recno() && Save record number.
SKIP && Skip to next record.
IF .NOT.EOF() .AND. oldval = &fld && Compare the field values.
? " Record " + LTRIM(STR(recno())) && Print message if the same
?? " Matches " + LTRIM(STR(oldrec)) && Print record numbers
?? ". Value = "
?? &fld && Print duplicate value
ENDIF
ENDDO && Repeat until end file
? "DONE. "