Sorting sets

Ruslan Zasukhin sunshine at public.kherson.ua
Wed Sep 8 17:09:19 CDT 2004


On 9/8/04 3:06 PM, "Erik Mueller-Harder"
<valentina-list at vermontsoftworks.com> wrote:

> On Sep 7, 2004, at 11:02, Ruslan Zasukhin wrote:
> 
>> Exists 2 kinds of Sets.
>> 
>> BitSet - it cannot be sorted
>> 
>> ArraySet -- it can be sort()
>> 
>> 
>> So VSet.Sort() have sense only for ArraySets.
>> It simply will sort array of RecIDs (i.e. Array of integers)
> 
> So how would I go about getting Valentina to return a set sorted by its
> value?  For example, I want a sorted list of the values of the field
> "title":
> 
> Dim rID as Integer
> Dim vs as VSet
> Dim vsi as VSetIterator
> 
> vs = db.tblVenue.title.FindNotNulls
> if vs <> nil then
>  vs.Sort   // (This doesn't do what I expect it to do.)
>  vsi = vs.MakeNewIterator
>  rID = vsi.FirstItem
>  me.recID(0) = rID
>  while rID <> 0
>    call db.tblVenue.GoToRecID(rID)
>    me.AddRow(db.tblVenue.title.value)
>    rID = vsi.NextItem
>    me.RecID.Append rID
>  wend
> end if
> 
> Thanks!

Then you need to use function Table.Sort().
I think it is not implemented yet.

To use it (without SQL) we need yet add to V4RB small class which will allow
us define 

    f2 ASC, f1 Desc,

This function Table.Sort() is able sort selection on the few fields.

We need just complete this for V4RB.


-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina-beta mailing list