Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why EOF crash in grid?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00049859
Message ID:
00049898
Views:
50
>>>This code segment is in a grid BeforeRowColChange to handle keyboard moves for highlighting. The page up works fine, but page down has an EOF crash:
>>>
>>>case lastkey_fn = 18  && page up
>>>  skip -10
>>>  if bof()
>>>    go top
>>>  endif
>>>case lastkey_fn = 3  && page down
>>>  skip 10
>>>  if eof()
>>>    go bottom
>>>  endif
>>>
>>>The code works fine outside of grid, and up/down arrows work fine in grid also. Any ideas?
>>
>>Basically, you shouldn't get the error, but if you got it, you could fortify your code like:
>>case lastkey_fn = 3 && page down
>>cError=on("error")
>>on error go bottom
>>skip 10
>>on error &cError
>
>Seems like a good idea, but instead of an EOF crash the app just closes up with no message. It seems to be a very serious error...

It might be some internal conflict between grid 'base' behaviour and skipping in code. When you press PGDN you already moved the pointer and then try to Skip 10 from presumably EOF(). Could you try to move code into AfterRowColChange event?
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform