hb_strDescend don't respect HB_SetCodePage

I'm using now:

/******************************************************************************************************************************************
*  +cDescend( cValue )
*
*  Retorna un valor invertido teniendo en cuenta el collation ESMWIN.
*  Esta función se puede usar en la creación de indices parcialmente 
descendentes.
*/
FUNCTION cDescend( cValue )
   LOCAL n, nPos
   LOCAL nLen := Len( cValue )
   LOCAL cRet := Space( nLen )
   //                   1         2         3         4         5         6     
    7         8         9         1
   // 1234567     8    
901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234
STATIC cOrden := ' !"#$%&' + "'" +'()*+,-./:;<=>?[\...@0123456789aÁbcdeÉfghiÍjklmnÑoÓpqrstuÚÜvwxyzaábcdeéfghiíjklmnñoópqrstuúüvwxyz'

   FOR n := 1 TO nLen
      IF ( nPos := At( cValue[n], cOrden ) ) > 0
         cRet[n] := cOrden[104 - nPos]
      ELSE
         cRet[n] := 255 - cValue[n]
      ENDIF
   NEXT

RETURN cRet

I think any similar but using collations, needs to be implemented at c level, 
by the moment DESCEND function
can't be used at index :

INDEX ON Upper( Code ) + Descend( FisrtName ) TAG CodeName TO Cust01

Best regards,
Miguel Angel Marchuet
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to