Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
I need to reinvent the clipper descend() in VFP
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01014420
Message ID:
01014455
Views:
16
Bob,

For numerics just subtract them from a big enough number as Hilmar suggested.

If the descend function works on alpha characters give this a try in your index expression (except that the function will have to be in the path every time you open the table).
function decsendalpha( lcStr )
return chrtran( upper(lcStr), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "ZYXWVUTSRQPONMLKJIHGFEDCBA" )
>If this is in the wrong conf, please point me to the correct one. Thanks!
>
>A client has a huge Clipper app (6.5 MB of source code) they want to port directly to VFP. No new screens. Just a port. Most of the code, amazingly, has ported. However I just ran into a brick wall.
>
>The Clipper app makes extensive use of the the DESCEND() function which does not exist in the same form in VFP. I badly need to reinvent it.
>
>In Clipper you can
>
>INDEX ON fld1 + descend( str(fld2, 7,2) )
>
>giving
>
>fld1 fld2
>-----------
>111 zzz
>222 yyy
>333 xxx
>
>This gives a different result than using the Foxpro DESCENDING clause with INDEX ON.
>
>Virually all the fields in this app using DESCEND() are character conversions of numerics. They have to be character because they are part of multi-field index keys.
>
>I've actually managed to re-invent a DESCEND() on character fields that works, but the performance hit is substantial. Anyone have ideas how to do this?
>
>PS I could do something dreadful like
>
>INDEX ON fld1 + descend( str(10000-fld2, 7,2) ) + fld3
>
>but would rather not.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform