FindLinked and FindLinkedAsBitSet inconsistency

Joakim Schramm joakim at astrocalc.com
Wed May 10 10:54:03 CDT 2006


 

> -----Original Message-----
> From: valentina-bounces at lists.macserve.net 
> [mailto:valentina-bounces at lists.macserve.net] On Behalf Of 
> Ruslan Zasukhin
> Sent: 10 May 2006 10:33
> To: valentina at lists.macserve.net
> Subject: Re: FindLinked and FindLinkedAsBitSet inconsistency
> 
> On 5/10/06 11:21 AM, "Joakim Schramm" <joakim at astrocalc.com> wrote:
> 
> Hi Joakim,
> 
> > This is all VCOM
> > 
> > I find the functions FindLinked and FindLinkedAsBitSet 
> functions to be 
> > inconsistent. The names imply they do the same thing but that's not 
> > really true.
> > 
> > FindLinked returns VArraySet based on parameters RecID as Integer , 
> > TableA as IVTable, TableBas IVTable
> > 
> > FindLinkedAsBitSet returns VBitSet (fine so far) BUT based in 
> > parameters inSet as IVSet, TableA as IVTable, TableBas 
> IVTable - with 
> > the current naming I expect first parameter to be RecID as 
> Integer as 
> > well, which the other link functions do returning as set 
> (if not apply to whole tables).
> > 
> > Now FindLinkedAsBitSet rather looks like a type of "convertion" 
> > function to me, and honestly I am not really sure how this 
> is supposed 
> > to work as the
> 
> You are RIGHT!
> 
> In C++ this function even is named still as ConvertBitSet()...
> 

Ruslan,

I am happy to hear I am not totally out in the blue on this :-)

> > Example is for FindLinked
> > 
> > Set res = Link.FindLinked( rec, TblA, TblB )
> > 
> > Which is same example as in other function.
>  
> > The mix of return sets IVBitSet and IVArraySet also makes these 
> > functions harder to use in an effective way, and harder to 
> understand.
> 
> 
> Explain me please, why you want to use BitSet ?
> 
> As far as I see, in YOUR Task as in many others:
> 
>     you have some RecID on left table
>     you need find SEVERAL linked records on right.
> 
> FindLinked() returns ArraySet() because it is easy assume 
> that number of childs linked to ONE left record will be not big.
> 
Why?

FindLinked() - Returns ArraySet
FindAllLinked - Returns BitSet

Look at this part in my code

If mCountryID <> 0 Then
    Set Col = mLink.FindLinked(mCountryID, tCountry, tPlaces)
Else
    Set Col = mLink.FindAllLinked(tCountry, tPlaces)
End If

I search places in either 1 or all countries and I want result in same
object for later processing. Now I have use a Vset object (Col) to obtain
this. If in next step I need an Array object I need to make a (unnecessary)
conversion and it complicates my code. Ok I know, I can leave Col as nil
just, but this may not always be convinient.

I here process further, all these Find functions returns BitSet, except 2
being alternative. My point is the mix of ArraySet and BitSet for returned
result makes theres functions harder and more complex to use together. It
forces me to write extra, unnecessary I think, code.

If ExactSearch <> 0 Then
    Set Res = fPlace.FindValueAsArraySet(PlaceName, Col)
Else
    Set Res = fPlace.FindContains(PlaceName, Col)
End If

If there was ArraySet and BitSet alternatives for them all it is fine, but
now it isn't.

This is my point. I might be wrong or am missing something as I am still new
to this tool.

Joakim
> 
> --
> 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]
> 
> 
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina
> 



More information about the Valentina mailing list