Bob, See: revQueryIsAtEnd revnumberofrecords
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 [email protected] -----Original Message----- From: use-livecode [mailto:[email protected]] 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 [email protected] Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode _______________________________________________ use-livecode mailing list [email protected] Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
