[VSDK ] Access to cursor fields

Ruslan Zasukhin sunshine at public.kherson.ua
Fri Jan 24 20:29:31 CST 2003


on 1/24/03 5:50 PM, Eric Forget at forgete at cafederic.com wrote:

>> Wouldn't this also work with an overloaded 'operator[]' so you can do:
>> 
>>     curs["Field1"] = (short) 5;
>> 
>> It seems more natural than having a method-call on the left-hand-side.
> 
> I'm not sure about that one.

As for me I have to see potential problems with []
As you know it can easy make hard bugs if you apply it to pointer.

    Cursor* curs;

    curs[i]  // BIG BIG ops


>  I would have thought about keeping the
> operator[] for navigating through all the records of the cursors. However,
> something like this would be nice:
> 
> curs[index]["Field1"] = (short)5;

No, this is not good.

Problem is that then you will at least TRY go to index record many times in
loop. 

> And
> 
> (*curs)["Field1"] = (short)5; // If you are already on the right index.

So I think it is still more safe and effective to use operator()


-- 
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://listserv.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list