FindLinked and FindLinkedAsBitSet inconsistency

Joakim Schramm joakim at astrocalc.com
Wed May 10 11:35:10 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 11:04
> To: valentina at lists.macserve.net
> Subject: Re: FindLinked and FindLinkedAsBitSet inconsistency
> 
> On 5/10/06 11:54 AM, "Joakim Schramm" <joakim at astrocalc.com> wrote:
> 
> > Why?
> > 
> > FindLinked() - Returns ArraySet
> 
> It will find NOT MANY records usually, e.g. 1-50 from million table
> 
> > FindAllLinked - Returns BitSet
> 
> Because it will find A LOTS of records, e..g 900,000 from 
> million table.
> 
> This is why.
> 
Yes I can understand that point, but it's still inconcistent, especially if
I can't pass an ArraySet to inSet as Vset to narrow further searches - don't
you agree?

I will try to show you again, I have tried to make this function work 100%
but it seem imposible. This version is a bit changed as it's another try to
make it work. All comments below is my explaination of the problem, to make
it clear in place.

Function SearchPlace(ByVal PlaceName As String, ByVal ExactSearch As Long)
As Long
Dim Col As VSet
Dim Res As VBitSet
Dim FirstRec As Long
Dim cnt As Long
Dim mLink As VLink

Set mLink = mAtlasDB.Link(lnkCountryHasPlaces)

'I want to get all linked records from 1 country, to search for a place
'I need to set Col to either VArraySet or VSet, VBitSet doesn't work
'If I want places from all countries I just leave Col as nil.
If mCountryID <> 0 Then
    Set Col = mLink.FindLinked(mCountryID, tCountry, tPlaces)
End If

'Based on the returned set of records, I like to do either an Exact OR
Partial search
'I must have Res as VBitSet here as all String functions only return BitSet
'Problem is just that If NOT Col Is Nothing Then FindValue will return nil,
probably because Col is NOT VBitSet
'If Col Is Nothing Then FindValue will return records, althoug Col not is
VBitSet
If ExactSearch <> 0 Then
    Set Res = fPlace.FindValue(PlaceName, Col)
Else
    Set Res = fPlace.FindContains(PlaceName, Col)
End If

'If I change above so Res is Varray or VSet, and use FindValueAsArraySet
'records are returned, but Col is not honored. It returns as if it was nil.
'Find Contains will error if Res is Varray.

'The rest is just further processing, not relevant here.

Set ResSearch = Res

If Not ResSearch Is Nothing Then
    cnt = ResSearch.Count
    Set ItrSearch = ResSearch.MakeNewIterator
    FirstRec = ItrSearch.FirstItem
    uCurrPlace = GetPlaceUDT(FirstRec)
End If

SearchPlace = cnt
End Function

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