type-casting

Ruslan Zasukhin sunshine at public.kherson.ua
Tue Mar 30 00:11:47 CST 2004


On 3/29/04 11:40 PM, "mdeh at earthlink.net" <mdeh at earthlink.net> wrote:

> Name:      
> 
> Question regarding: v4rb
> 
> Ruslan,

> I am curious. Why is Valentina set up so that you have to use type-casting to
> obtain a ref to subclasses of Vfield? (in both BO and Cursor Fields)

> Does it have something to do with keeping the progam small?

no

> Or is there something else  that I am missing.

This is OO-programming.

We have Vfield, and we have its subclasses, e.g. Vlong.

On default cursor can return ONLY and ONLY Vfield.

        curs.Field("") as VField
                        ^^^^^^^^^ parent of all

But if you want get something specific from child class?
How you can do that?

Only you need type cast.

You could see that cursor have special set of functions
That do casting self. This is just for comfort although.


-- 
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