Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
I need to reinvent the clipper descend() in VFP
Message
From
15/05/2005 19:11:14
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
I need to reinvent the clipper descend() in VFP
Miscellaneous
Thread ID:
01014420
Message ID:
01014420
Views:
113
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.
Next
Reply
Map
View

Click here to load this message in the networking platform