Design question

Ruslan Zasukhin sunshine at public.kherson.ua
Wed Dec 3 15:50:11 CST 2003


on 12/3/03 3:39 PM, Arthur Clemens at aclemens at xs4all.nl wrote:

>>> This I could not find, how to make a set if I have a cursor.
> 
> Can you point me to the method I should use?

There is no method.
You need do this self.


>> And note, RecID are in RAM, so iteration will be very fast.
>> 
>> Also to be even faster, get pointer on Ulong field BEFORE loop.

> So:
> 
> unsigned long RecID;
> cursor->GetULong( "RecID" );
> do {
>        RecID = cursor->GetULong( "RecID" );
>        if (RecID != NULL) {
>            NSLog(@"found: %d", RecID);
>        }
>    } while( cursor->NextRecord() );
> 
> (?)
> 
> Why is this faster?

No.

    VDK_ULong* pFld = cursor->GetULongField( "RecID" );

    do {
        RecID = (ulong) pFld;
        if (RecID != 0 ) {
            NSLog(@"found: %d", RecID);
        }
    } while( cursor->NextRecord() );


Taking into account that RecId is not nullable, and cannot be method,
You can do even next trick:

    VDK_ULong* pFld = cursor->GetULongField( "RecID" );
    FBL_REC_ID* pRecID = (FBL_REC_ID*) pfld->GetDataPtr();

    do {
        if( *RecID != 0 ) {
            NSLog(@"found: %d", *RecID);
        }
    } while( cursor->NextRecord() );



-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list