[V4RB 0000631]: VBitSet and VArraySet cannot use Union, Difference, Intersection, etc.

Ruslan Zasukhin sunshine at public.kherson.ua
Mon Apr 4 16:45:01 CDT 2005


On 4/4/05 4:40 PM, "Kem Tekinay" <ktekinay at mactechnologies.com> wrote:

> I can't turn a *VSET* into a VArraySet.

Kem, but NOT exists just a Vset.

Vset -- this is abstract class. You cannot have objects of Vset class.

You can have only objects of VBitSet or VArraySet.

> How do I get the VSet returned by
> Union, Difference, etc., into a VArraySet?
> 
> The example above should be:
> 
> 
>   dim bitset1, bitset2 as VBitSet
>   dim set1 as VSet
>   dim arrSet as VArraySet
> 
>   bitset1 = fld.FindStartsWith( something )
>   bitset2 = fld.FindStartsWith( somethingElse )
> 
>   set1 = bitset1.Union( bitset2 ) // So far, so good
    ^^^^^
    this is VBitSet object in reality.
    I think if you will open it in RB debugger right here
    you will see that this is VBitSet.

>   arrSet = VArraySet( set1 ) // IllegalCastException at runtime
>   arrSet = new VArraySet( set1 ) // Wrong type of parameter

Correct line:

    arrSet = new VArraySet( VBitSet(set1) )


> And, frankly, this seems the wrong behavior anyway. If I create a Union
> between two VArraySet, why should my result be a VSet rather than a
> VArraySet? This is especially true since the VSet is an abstract class
> according to the Kernel reference.
> 
> I'm sorry if I'm being a pain about this, but the only solution I can come
> up with is to create a VSetIterator and place all the recIDs into my own
> array, but that seems like a slow way to do it.

-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list