[V4REV] VTable_SortN syntax discussed.

Ruslan Zasukhin sunshine at public.kherson.ua
Sun Jun 12 08:39:39 CDT 2005


On 6/12/05 2:17 AM, "Robert Brenstein" <rjb at robelko.com> wrote:

>>     We are going to have VTable_SortN method in order to support
>> multiple-fields
>>     table sorting.
> 
> You mean this will allow us to resort an existing cursor? But then
> may be not since it has tableRef not cursorRef.

NO, this is for API way which do not use cursors at all,
 
>>     What do you think - how params should be looked?
>> 
>>     1.
>>     put VTable_SortN(
>>                      tblRef,
>>                      setRef,
>>                      fld1, inBoolAscending1,
>>                      [ fld2, inBoolAscending2,
>>                        fld3, inBoolAscending3,
>>                        fld4, inBoolAscending4 ] ) INTO ArraySetRef
>> 
>>     Example:
>>             put VTable_SortN( t1,allSet, f1, true, f2, false )
>> 
>>     2.
>>     put VTable_SortN(
>>                      tblRef,
>>                      setRef,
>>                      "fld1 inBoolAscending1",
>>                      [ "fld2 [inBoolAscending2 = true]",
>>                        "fld3 [inBoolAscending3 = true]",
>>                        "fld4 [inBoolAscending4 = true]" ] ) INTO ArraySetRef
>> 
>>     Example:
>>             put VTable_SortN( t1,allSet, f1, "f2 false" )
>> 
> 
> #2 will surely be source of errors. Don't like it at all. But without
> fully understanding what this function does, I am not sure whether
> there is a better syntax than your #1.

You have TableRef and some SET of records for this table.
You want sort this set by one or two or three or more fields.

In SQL we use 
    ORDER BY f1, f2 DESC, f3, f4

In API we can do 

 put VTable_SortN( t1, Set1, f1, kAsc, f2 kDesc, f3 kAsc ) into SortedSet

Or using strings -- style of Revolution

 put VTable_SortN( t1, Set1, "f1, f2 kDesc, f3" ) into SortedSet


In second case we have single last param,
and V4REV should self parse string,
and it looks we can avoid writing of kAsc.


-- 
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]




More information about the Valentina mailing list