[V4RB V2] VArraySet sorting problems
Erik Mueller-Harder
valentina-list at vermontsoftworks.com
Tue Mar 22 14:32:10 CST 2005
>> The documentation, however, says the result should be a VArraySet --
>> and that is actually what I want (since I want to use the VArraySet's
>> ItemAt method).
>
> But ArraySet is child of Vset. So I always have right to write
>
> dim set as VSet
> set = tbl.Sort()
>
> Although in this case I cannot access methods of ArraySet class.
> In my example I do not need them, so I have cast to set.
> This is pure OO issues, Erik.
Makes sense. I hadn't thought about VArraySet being a child of VSet.
OK.
>> Switching ascendingFlg to True has no effect.
>>
>> This code was working for me two or three weeks ago; I don't believe
>> anything has changed other than the version of Valentina. I'm
>> currently using the most recent v2 beta, from 2005-03-10.
>>
>> Is this a bug? Or am I doing something incorrectly?
>
> I can think only about bug related to Vdate field.
> Hmm, please try some other numeric field.
> If in this case answer is correct.
Well, I modified your Records_Sort example to include a VDateTime
field, and it worked correctly. But the only substantive difference I
can see between the code there and my own is the use of VSet instead of
VArraySet (which I understand now shouldn't be important). I'll keep
looking....
>> [On a related note, FYI, I've noticed that in all circumstances, even
>> when sorting works correctly (such as your Records_Sort example), the
>> VSet's (or VArraySet's) IsSorted method *always* returns False.]
>
> Set.IsSorted() and set.Sort()
>
> Are related to sorting of RecIDs inside of set.
> I afraid this will confuse RB developers, and may be should be removed.
>
> Ignore them for now. They exists for other tasks.
I think the confusion would simply be from their names. If they were
called Set.IsSortedByRecID and Set.SortByRecID, there wouldn't be any
confusion -- and there might even be some use for them.
Thanks,
-- Erik
More information about the Valentina-beta
mailing list