Problem with revNumberOfRecords

Jérôme Rosat jrosat at mac.com
Sun Feb 13 17:24:41 EST 2005


Dear Jan

Thank you for your answer, but the solution doesn't work.

I send this message I few month ago to say that the 
'revCurrentRecordIsLast'  and 'revCurrentRecordIsFirst'  in Dreamcard 
(and probably in Revolution) doesn't  work (see the following message):

Any other solution ?

Best regards

Jérôme

Bonjour Jan,

Yes I use MySQL. After creating a recordset, I execute: 
'revMoveToFirstRecord' (go to the first record). Results:

'revNumberOfRecords'      : 3
'revCurrentRecord'        : 0
'revCurrentRecordIsLast'  : false
'revCurrentRecordIsFirst' : false ???

Then I execute 'revMoveToNextRecord' (go to the second record). Results:

'result()                 : true
'revNumberOfRecords'      : 3
'revCurrentRecord'        : 1
'revCurrentRecordIsLast'  : false
'revCurrentRecordIsFirst' : false

Then I execute 'revMoveToNextRecord' (go to the third and last record). 
Results:

'result()                 : true
'revNumberOfRecords'      : 3
'revCurrentRecord'        : 2
'revCurrentRecordIsLast'  : false ??
'revCurrentRecordIsFirst' : false

Then I execute 'revMoveToNextRecord' (just to see). Results:

'result()                 : false
'revNumberOfRecords'      : 3
'revCurrentRecord'        : 2
'revCurrentRecordIsLast'  : true
'revCurrentRecordIsFirst' : false

I hope it is clear.

Jérôme Rosat

Le 6 nov. 04, à 06:25, Jan Schenkel a écrit :

> --- Jérôme Rosat <jrosat at mac.com> wrote:
>> Bonjour tout le monde,
>>
>> In Dreamcard documentation, for the
>> revCurrentRecordIsLast function,
>> it's written that "Returns whether the current
>> record is the last
>> record in a record set (database cursor)."
>>
>> In my recordset with 3 records, when the cursor is
>> on the first record,
>> revCurrentRecordIsLast return false. It's Ok for me.
>> After moving the cursor with revMoveToNextRecord to
>> the second record,
>> revCurrentRecordIsLast return false. It's still OK
>> for me.
>> If I move the cursor to the third and last record,
>> revCurrentRecordIsLast still return false. With the
>> upper definition,
>> the result should be true. The third record is the
>> last one.
>> But revCurrentRecordIsLast return true only if I use
>>
>> revMoveToNextRecord once again. In short,
>> revCurrentRecordIsLast return
>> true when revMoveToNextRecord return an error. And
>> it is the same for
>> revCurrentRecordIsFirst.
>>
>> Is it a bug or I'm stupid ?
>>
>> Jérôme Rosat
>>
>
> Bonjour Jérôme,
>
> What does the function 'revNumberOfRecords' return for
> that result set ? And is this still on MySQL ?
>
> Jan Schenkel.
>
> =====
> Join us at the European Revolution Conference
> November 14-16, MALTA. ~ http://TechieTours.com/Rev/
>
> =====
> "As we grow older, we grow both wiser and more foolish at the same 
> time."  (La Rochefoucauld)
>
>
> 		
> __________________________________
> Do you Yahoo!?
> Check out the new Yahoo! Front Page.
> www.yahoo.com
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
_______________________________________________
use-revolution mailing list
use-revolution at lists.runrev.com
http://lists.runrev.com/mailman/listinfo/use-revolution


Le 13 févr. 05, à 22:54, Jan Schenkel a écrit :

> --- Jérôme Rosat <jrosat at mac.com> wrote:
>> Dear all,
>>
>> I use a stack with a MySQL database. To move through
>> the records in a
>> record set I use this script:
>>
>>    revMoveToFirstRecord thisCursor
>>    repeat for revNumberOfRecords(thisCursor) times
>>      -- bla bla
>>      revMoveToNextRecord thisCursor
>>    end repeat
>>
>> When I use the same stack with a Access 97 database
>> and a ODBC
>> connection and the same number of records, the
>> revNumberOfRecords
>> function return -1.
>>
>> How to resolve this problem ?
>>
>> Jérôme Rosat
>>
>
> Hi Jérôme,
>
> This particular problem has been around forever, and
> is appearently a conflict between Access and the revdb
> ODBC driver.
> Your best solution is to use the 'revdb_iseof()' or
> 'revCurrentRecordIsLast()' functions to determine the
> end of your loop :
> --
>    revMoveToFirstRecord thisCursor
>    repeat forever
>      -- bla bla
>      if revCurrentRecordIsLast() then exit repeat
>      else revMoveNextRecord thisCursor
>    end repeat
> --
>
> Hope this helped,
>
> Jan Schenkel.
>
> =====
> Quartam - Tools for Revolution
> <http://www.quartam.com>
>
> =====
> "As we grow older, we grow both wiser and more foolish at the same 
> time."  (La Rochefoucauld)
>
>
> 		
> __________________________________
> Do you Yahoo!?
> The all-new My Yahoo! - Get yours free!
> http://my.yahoo.com
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
Jérôme Rosat
13, chemin des Palettes
1212 Grand-Lancy

022 880 20 70


More information about the use-livecode mailing list