Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Skip does not move record pointer 1

Status
Not open for further replies.

geralyn

Programmer
Dec 10, 2003
17
0
0
US
I inherited a legacy program writen in Foxpro 2.6 for DOS. There is a table (with structural CDX) which is the parent to two related tables. During the processing there is a skip command and a skip -1 command right underneath it. (Not sure why this was done, possibly to ensure updating of some code in a procedure somewhere else?). The problem is, sometimes the record pointer does not move on the first skip command... it always does the skip -1. Any ideas? When I open up the tables from the command lines and get the 'bad' record, it will not move...I can page down past it etc...reindexing, recreating the tags makes no difference. Fox seems to think it's a totally valid table. But if I move the cursor around, it even displays some of the field information in the last two fields in the wrong spots...I've ran scanners on it and the HF utility to fix the header (I get no errors) to no avail.
 
My first attempt to fix the problem would be to "reindex" the file. i.e. DELETE TAG ALL and then recreate the indexes (depending on if and how an index file is corrupted, a REINDEX command might not fix it).

Rick
 
The reason is simple. When the pointer is at eof(), i.e. after skip is issued when the pointer is at the last ,then the pointer goes to the eof(). Now again skip is issued, it will not move the pointer but if skip -1 is issued the the pointer will go back to the last record. Again you have to remember that when the physical last record and the last record when file is indexed & ordered are different.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top