Ah right, you need to use a combination of OrdCondSet() and OrdCreate() for that.
I did an experiment, took the UDC from VO, adjusted it a little bit and it seems to work. If you'd like to give it a try, add this definition in the beginning of your prg:
Code: Select all
#command INDEX ON <key> ;
[TAG <order>] ;
[TO <file>] ;
[FOR <fo>] ;
[<all:ALL>] ;
[WHILE <wh>] ;
[NEXT <nx>] ;
[RECORD <rec>] ;
[<rs:REST>] ;
[EVAL <ev>] ;
[EVERY <evr>] ;
[<u:UNIQUE>] ;
[<asd:ASCENDING>] ;
[<dsd:DESCENDING>] ;
[<lCur:USECURRENT>] ;
[<lAdd:ADDITIVE>] ;
[<lCus:CUSTOM>] ;
[<lNop:NOOPTIMIZE>] ;
;
=> OrdCondSet( <fo>, <{fo}>, ;
[<.all.>], ;
<{wh}>, ;
<{ev}>, <evr>, ;
RecNo(), <nx>, <rec>, ;
[<.rs.>], [<.dsd.>], ;
<.lAdd.>, [<.lCur.>], [<.lCus.>], [<.lNop.>] ) ;
;; ;
OrdCreate(<(file)>,<(order)>,<(key)>,,IF(<.u.>,.T., NIL))
Code: Select all
INDEX ON CHIAVE TAG CHIAVE TO filename.cdx EVAL {||oSelf:DOProgress( 2 )} EVERY 10
.