[ RB4] To test a cursor ?
Deane Venske
dean at eduss.com
Fri Oct 24 16:10:48 CDT 2003
Ruslan Zasukhin wrote:
>on 10/24/03 8:19, Deane Venske at dean at eduss.com wrote:
>
>
>
>>Deane Venske wrote:
>>
>>
>>
>>>A pretty good method, in my opinion, to loop through records is the
>>>following code which saves declaring integer variables to use in the
>>>FOR loop.
>>>
>>> while cursor.NextRecord() = TRUE
>>> // Loop through records.
>>> wend
>>>
>>>Deane Venske
>>>
>>>_______________________________________________
>>>Valentina mailing list
>>>Valentina at lists.macserve.net
>>>http://lists.macserve.net/mailman/listinfo/valentina
>>>
>>>
>>>
>>Just looked over the code. Tim's code is better. Mine skips the first
>>record *mutter*
>>
>>
>
>Yes, your code skip the first record.
>
>
>NOTE: some DBMS (and ODBC) love such loop.
> but it is crazy for me, that to be able do such loop,
> they use POSTION BEFORE FIRST RECORD
>
> yes, when they create cursor it is NOT on first record.
>
>
>I never have like this, so in Valentina I have implement more logical way
>IMHO.
>
>And for Valentina more correct loop is
>
> curs =
>
> do
> ....
> while curs.NextRecord()
>
>
>
That is in fact how I did have it previously. I am going to change it
back. The only problem with this loop is you MUST check for
cursor.firstRecord() = True before running the do loop.
Deane
More information about the Valentina
mailing list