Hi All,

I have stored the result of a query in a cursor. My program is such that I need to scroll back and forth in the result set. How can I at any point of time, check whether, I am at the beginning of the result set; so that I don't try to scroll before the beginning of the file?

if cursor_name.bof()
..
..
endif

cursor_name.bof() is giving an error - Object cursor_name not found!

Any suggestions to solve this problem would be greatly appreciated.

Regards

Re: Finding the beginning of the result set by Eric

Eric
Mon Jun 28 03:41:11 CDT 2004

Hello, sm!
You wrote on Mon, 28 Jun 2004 01:30:01 -0700:

A cursor is not an object and it does not have a Bof() method. There is a
BOF() function:

SELECT cursor_name
IF BOF()
...
also
IF EOF() && end of file
...

You can also specify the alias, so that the SELECT is not needed:
IF BOF("cursor_name")

To quickly go to the first record, issue LOCATE
SELECT cursor_name
LOCATE
--
Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By VFP8



Re: Finding the beginning of the result set by christophe

christophe
Mon Jun 28 03:50:59 CDT 2004

Sm,

if bof("cursorname")
...
endif

or another example

do while .not. bof("cursorname")
....
skip -1 in "cursorname"
enddo

christophe
--
\|||/
(o o)
----ooO-(_)-Ooo-------------

¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°
º


"sm" <sm@discussions.microsoft.com> schreef in bericht
news:C6EC2487-193E-4252-BBFD-0E9BBD8EDAE8@microsoft.com...
> Hi All,
>
> I have stored the result of a query in a cursor. My
program is such that I need to scroll back and forth in the
result set. How can I at any point of time, check whether, I
am at the beginning of the result set; so that I don't try
to scroll before the beginning of the file?
>
> if cursor_name.bof()
> ..
> ..
> endif
>
> cursor_name.bof() is giving an error - Object cursor_name
not found!
>
> Any suggestions to solve this problem would be greatly
appreciated.
>
> Regards
>