Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need to Combine Ascending and Descending Indexes
Message
From
25/02/1999 06:27:33
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00190759
Message ID:
00191326
Views:
14
>Greetings!
>
>I need to set up an index to sort records using a mix of ascending and descending orders, using character fields.
>
>I recall this could be done using the SYS(15) function ("included for backward compatibility"). I've done it before, but now do not remember how! Apparently, the list of fields in the sort order would include something like "SYS(15, "ZYXW...", field)". This would cause the field to be sorted in descending order by substituting each character--a "Z" for an "A", "Y" for "B", and so forth.
>
>However, it does not work. Does anyone else know how to do this?
>
>Thanks!
>
>Michael Reynolds

The second parameter in sys(15) must be 256 characters long, i.e. full table. Its first character is a replacement for chr(0), its nth a replacement for chr(n-1). Maybe there are workarounds for this, but I'm not sure.
cTable=""
for i=0 to 255
   ctable=ctable+chr(255-i)
endfor
index on sys(15, ctable, yourcharfield) ...

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform