Last record of a cursor?

Ralph DiMola rdimola at
Fri Sep 17 19:23:16 EDT 2021



If the number of records is 0 then no results were returned.
If revQueryIsAtEnd is true then you're at the end. This will happen after
you do an additional revMoveToNextRecord when on the last record.

Ralph DiMola
IT Director
Evergreen Information Services
rdimola at

-----Original Message-----
From: use-livecode [mailto:use-livecode-bounces at] On Behalf
Of Bob Sneidar via use-livecode
Sent: Friday, September 17, 2021 7:05 PM
To: How to use LiveCode
Cc: Bob Sneidar
Subject: Last record of a cursor?

Hi all. 

I am trying to discern between when I have an empty cursor, and when I have
reached the last record of a cursor. 

I have noticed that if I query a database that returns no results, I still
get a cursor ID, so I cannot test for a cursor ID. So after my loop to
convert a cursor to an array, I check to see if I am on the last record by
using put revCurrentRecord(pCursorID) into tLastRecord, then testing to see
if it returns 0, which it will if the cursor is empty. 

But it seems that if I am already on the last record of the cursor, then I
use revMoveToNextRecord pCursorID, revCurrentRecord ALSO RETURNS 0! So now I
am left without a way to tell if the cursor is empty, or if otherwise, I
have reached the last record. 

How is this done?? Normally I use sqlYoga so these things are spared me, but
in this instance I am using the native API calls. 

Bob S

use-livecode mailing list
use-livecode at
Please visit this url to subscribe, unsubscribe and manage your subscription

More information about the use-livecode mailing list