V4RB, syntax for sorting of sets.

Ruslan Zasukhin sunshine at public.kherson.ua
Wed Oct 6 00:11:02 CDT 2004


Hi all,

I want discuss one point.

So let we have selection as result of Find()

    dim set as Vset

Now I add to Vtable class new method

    Sort( set, fld, Ascending ) as VSet

This method allow us to sort selection of found records by single field.
Also we must to have other function, that will allow us sort by few fields.

It can looks for example as

    Sort( set, order() as VSortPair ) as VSet


Then in REALbasic code we could do

    dim order as array  ?

    order(1) = new VSortPair( f1, kAsc )
    order(2) = new VSortPair( f3, kDesc )
    order(3) = new VSortPair( f2, kAsc )

    SortedSet = t.Sort( set, order )


Do you like such syntax?

It seems we have no other way for RB...




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