FUNCTION Reversechars(lcChars) > LOCAL lnI > FOR lnI=1 TO LEN(lcChars) > lcChars=STUFF(lcChars,lnI,1,CHR[255-ASC(SUBSTR(lcChars,lnI,1))]) > ENDFOR > RETURN lcChars >ENDPROC >>
>>&& simple solution >>&& use a view >> >>create sql view ViewOnTablexx as ; >> select ..... ; >> from Tablexx ; >> order by Fieldx desc, Fieldy asce >>>>
>>function CharBitNot(s) >> return chrtran(m.s, chr(0)+chr(1)+chr(2).....+chr(255), chr(255)+chr(254)....+chr(1)+chr(0)) >>endfunc >> >>select Table >>index on CharBitNot(Fieldx) + Fieldy tag pp >> >>&& performancewise it would be best to build the chrtran() arg2 and arg3 >>&& in the init of your program, you could >>=_screen.AddProperty(BitNotCharFrom, chr(0)+chr(1)+chr(2).....+chr(255)) >>=_screen.AddProperty(BitNotCharTo, chr(255)+chr(254)....+chr(1)+chr(0)) >>&& or use a loop to build them >> >>select Table >>index on chrtran(Fieldx, m._screen.BitNotCharFrom, m._screen.BitNotCharTo) + Fieldy tag pp >> >>>>