[V4RB2] Union problem

Ruslan Zasukhin sunshine at public.kherson.ua
Mon Apr 4 08:54:34 CDT 2005


On 4/4/05 12:09 AM, "Kem Tekinay" <ktekinay at mactechnologies.com> wrote:

>> It complains because Union returns Vset.
>> But you try assign to to bs which is VBitSet1
>> 
>> You see?
> 
> Yes, but the Valentina_Kernel_2 documentation reads on page 89:
> 
>> Union( inRightSet as VSet ) as Vset
>> 
>> Executes a union of this set with the
>> inRightSet. The result becomes this set. Such an  operation is said to be "in
>> place".
>> 
>> NOTE: BOTH SETS MUST BE OF THE SAME TYPE (BITSET OR ARRAYSET). <<<----
> 
> The 4RB_Refeerence_2_en says the same thing on page 134.
> 
> If you're telling me now that they must both be cast as VSet, that's fine,
> except, as I said in the last e-mail, I can't seem to find a way to turn a
> VSet into a VBitSet or a VArraySet without RB complaining. I think there
> should be constructors like VBitSet( inSet as VSet ) and VArraySet( inSet as
> VSet ) that would handle the conversion for me.

Everything is correct in the docs.

Look again on your code:

------------------------------------
 dim bs, bs1 as VBitSet

 bs = tbl.SelectNoneRecords // This is ok
 bs1 = tbl.fld.FindContains( something ) // This is ok
 if bs1 <> nil then
    bs = bs.Union( bs1 ) // Type mismatch error
------------------------------------

This line 

    bs = bs.Union( bs1 ) // Type mismatch error

Kem, this part is CORRECT
    
    bs.Union( bs1 )

Mistake is next. Union returns Vset. See docs above.
So you must assign it to Vset.
This will work

 dim bs, bs1 as VBitSet
 dim set as VSet   

 bs = tbl.SelectNoneRecords
 bs1 = tbl.fld.FindContains( something )
 if bs1 <> nil then
    set = bs.Union( bs1 )


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