Cursor.FindSingleValue
Thomas Flemming
tf at ttqv.com
Tue Dec 29 04:54:04 CST 2009
Hi Ivan,
....
> But probably FindIndex() is not implemented for VNET.
No, its not.
I think, I'm using the wrong language.... :-(
> (probably you may even sort this set by
> RecID first - for speeding up searching - see documentation)
no, must use sort of cursor.
But anyway, iterating through the arrayset works at a reasonable speed.
Its funny, but mCur.ToArraySet is almost in zero-time.
Only the loop takes time.
Private arrayset As VArraySet = cursor.ToArraySet
For i As Integer = 1 To arrayset.Count
If arrayset.ItemAt(i) = recid Then
CursorPosition = i
Exit For
End If
Next
> The only pitfall is an additional memory for that arrayset.
How much for 1 mio records?
Thanks,
Tom
Ivan Smahin schrieb:
> Hello Thomas,
>
> Tuesday, December 29, 2009, 11:54:25 AM, you wrote:
>
>> Hi Ivan,
>
> >> vCursor1.put_RecID( RecID_Of_Cursor2 );
>
>> Yes, this would be perfect, I was already looking for this.
>> but unfortunally something like this is not in VNET 4.3
>> Or am I missing something?
>
> Well there is another way. Probably even faster one.
>
> There is a method VCursor::ToArraySet() which produces
> set of original recIDs.
> You may do it once -
> pSet = vCursor1.ToArraySet();
>
> Then you know how to get an recID using the second cursor.
>
> And you need only find an appropriate position in arrayset for
> particular recID.
>
> In C++ it should be as simple as
> ArraySet_Ptr pSet = pCur->ToArraySet();
> vuint32 pos = pSet->FindIndex( inRecID );
>
> But probably FindIndex() is not implemented for VNET.
>
> Anyway you may get a set iterator (probably you may even sort this set by
> RecID first - for speeding up searching - see documentation)
> and then looking for position with set iterator.
>
> The only pitfall is an additional memory for that arrayset.
>
>
>
--
/****************************************
** Dipl.-Ing. Thomas Flemming
** Software Development
**
** Touratech AG
** Auf dem Zimmermann 7-9
** D-78078 Niedereschach
**
** mail tf at ttqv.com
** fon +49 (0) 7728 9279-206
** fax +49 (0) 7728 9279-29
**
** http://www.ttqv.com
** http://www.touratech.de
**
** ... und immer dem Pfeil nach!
***************************************/
More information about the Valentina
mailing list