Ahsan Amin


In a navigation form i am using skip command on a button but it's not working fine. When it comes to 2nd last recoed it does not proceed. There also some records in table marked as deleted. I am using Set deleted On on form's Init event. I have also clicked on button many times so that it could give eof error but it does not. Also record no. message on bottom of VFP's window is always same. It does give eof error when i set deleted off.



Re: Skip Command

CetinBasoz


Check these:

-Set skip in effect

-Skipping on correct workaera

-Is there a relation in effect and refresh causing pointer to move back on a child table

-Is there on error in effect






Re: Skip Command

dni

You may try to change skip with:

IF .NOT.EOF()

SKIP

ELSE

*message or action if is end of file

ENDIF







Re: Skip Command

Tamar E. Granor

This is the kind of problem that can often be solved by using the Debugger. Put the following in the Watch window:

ALIAS()
RECNO("the alias you're trying to skip in")

and step through the code in the button. You'll probably be able to see exactly what's wrong.

I also want to point out that in any command that accepts it, you should _always_ use the IN clause to be sure you're talking to the right table.

Tamar




Re: Skip Command

okboy

how to skip to the last record and go back to first record

if i used skip it just go to next record only and skip -1 it just go back to previous 1 record only...





Re: Skip Command

Vladimir Zografski

Code Snippet

*** Positions the record pointer on the last record in the table.

*** If the table has an ascending index in use, the last record is

*** the record with the highest key value. If the index is in descending order,

*** the last record is the record with the lowest key value.

GO BOTTOM IN YourDbf

*** Positions the record pointer on the first record in the table.

*** If the table has an ascending index in use, the first record is the record with the lowest key value.

*** If the index is in descending order, the first record is the record with the highest key value.

GO TOP IN YourDbf






Re: Skip Command

RavindraPatil

go top , go bottom





Re: Skip Command

LeoLems

Hi Ahsan,

All the correct answer are already in this post...

skip commands: go top, go bottom, skip, skip-1

There is a catch however...

Make sure you are in the correct workspace (alias).

So do a "select <mytable>" before you do the commands above !!!

This way you are always skipping in the corect table or workspace

After the skip you can encounter an error so check for EOF() before you skip

greetings,

Leo






Re: Skip Command

Tamar E. Granor

Leo - as I said earlier in the thread, rather than counting on being in the right work area, it's always a better choice to use the IN clause to make sure you're working in the right work area:

GO TOP IN MyAlias

will always work on MyAlias.

SELECT MyAlias
GO TOP

will almost always work in MyAlias, but if there's a timer or something else that can interrupt between the two lines of code, the work area can be changed.

Include the IN clause in every command that accepts it every time you use it.

Tamar




Re: Skip Command

LeoLems

@Tamar,

You are absolutely right.. Timers are nasty little buggers, that can alter things like current workspace.

Leo