xsharp.eu • is record in index
Page 1 of 1

is record in index

Posted: Fri Jan 26, 2024 7:37 am
by ecos
Hi everybody,

after only 30 years of programming in clipper, VO and x# I have a beginner's question:

Is there a simply way to determine, if the current record is part of a conditional index, maybe even with scopes set ?
I used (orderkeyno()<>0) so far, but this gets extremely slow with big tables.

TIA
Karl

Re: is record in index

Posted: Fri Jan 26, 2024 8:48 am
by robert
Karl,
You can get the index condition and macro compile and evaluate it
And then you can get the index key value and the current top and bottom scopes and compare that value with the current scopes (if any)

- DbOrderInfo(DBOI_CONDITION) for the condition
- DbOrderInfo(DBOI_KEYVAL) for the current keyvalue
- DbOrderInfo(DBOI_SCOPEBOTTOM) and DbOrderInfo(DBOI_SCOPETOP) for the scopes

see https://www.xsharp.eu/runtimehelp/html/ ... erInfo.htm for other possible DBOI_ values

Robert

Re: is record in index

Posted: Fri Jan 26, 2024 8:58 am
by ecos
Hi Robert,
that's exactly what I intended to do after the customer has complained about performance.
I just wondered whether there is a (maybe hidden) method/function for this i didn't know about...

Karl