Sorting sets

Erik Mueller-Harder valentina-list at vermontsoftworks.com
Wed Sep 8 08:06:33 CDT 2004


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!

-- Erik



More information about the Valentina-beta mailing list