Michael Savage wrote on 2011-09-20: 
>  I have a table, with two indexes. (In a cdx file)
>  
>  I need to know the new place in the table when the order changes.
>  ie if it is the second record in the table in sort order #1, what is it
>  in order #2.
>  
>  Let say that in order 1 it is the 2nd record, but in order #2 it would
>  be the fifth record.
>  How do I find out when I switch order, what position it's in?
>  
>  Can't use recno(), what other functions is there.
>  Mike
> 

Michael,

The only sure way I came up with is using some select statements

      LOCAL currentrow, record_position_01, record_position_02, keyvalue
      SET ORDER TO 2
      m.currentrow = EVALUATE(KEY(1))
      m.keyvalue = KEY(1)
      SELECT (KEY(1)) FROM (ALIAS()) TO SCREEN NOCONSOLE WHERE
&keyvalue.<=m.currentrow
      m.record_position_01 = _TALLY 
      SET ORDER TO 2
      m.currentrow = EVALUATE(KEY(2))
      m.keyvalue = KEY(2)
      SELECT (KEY(2)) FROM (ALIAS()) TO SCREEN NOCONSOLE WHERE
&keyvalue.<=m.currentrow
      m.record_position_02 = _TALLY 

      ?m.record_position_01,m.record_position_02

I'm not sure why position is needed, unless you are dealing with a TreeView
type of positioning. 

Tracy Pearson
PowerChurch Software


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to