Page 3 of 3

Re: ÍNDICE o INDICE

Posted: Sat Apr 03, 2010 8:14 pm
by Czarny_Pijar
Czarny_Pijar wrote:Me gustaría presentar la función inspirado en esgici, que cumpla con los objetivos de Algernon

I'd like to present the function inspired by esgici, that fulfills the goals of Algernon

Code: Select all

#define cEspCharSet_1 "AÁaáBbCcDdEÉeéFfGgHhIíJjKkLlMmNnÑñOoPpQqRrSsTtUuVvWwXxYyZz"
#define cEspCharSet_2 "AAaaBbCcDdEEeeFfGgHhIíJjKkLlMmNnNnOoPpQqRrSsTtUuVvWwXxYyZz"

******
*
* EspAColSeq    : Español Alternate Collating Sequence
*
FUNC EspAColSeq(  cInStr  )                       // Español Alternate Collating Sequence
   LOCA cOutStr      := "",;
        cLetter_in   := "",;
        cLetter_out  := "",;
        nCounter     :=  0,;
        nChrPtr      :=  0

   FOR  nCounter := 1 TO LEN( cInStr )
      cLetter_in := SUBS( cInStr, nCounter, 1) 
      nChrPtr    := AT( cLetter_in, cEspCharSet_1 )
      cLetter_out:= IIF( nChrPtr == 0, cLetter_in, SUBS(cEspCharSet_2, nChrPtr, 1 ))
      cOutStr     := cOutStr +  cLetter_out
   NEXT

RETU cOutStr
Beware! Not tested!
Mejor es mejor que bueno. Al cambiar estas líneas usted mejorará la velocidad con la misma funcionalidad.

Better is better than good. By changing these lines you'll improve the speed with the equal functionality.

Code: Select all

#define cEspCharSet_1 "ÁáÉéÑñ"
#define cEspCharSet_2 "AaEeNn"
Beware! Also not tested!

Re: ÍNDICE o INDICE

Posted: Sat Apr 03, 2010 8:29 pm
by esgici
Hi Czarny

Are you sure that this way is adequate ?

If two or more key are equal how will be its sequence ?

Regards

--

Esgici

Re: ÍNDICE o INDICE / Upper or Lower ?

Posted: Tue Oct 18, 2011 10:51 pm
by esgici
Hi All

Code: Select all

SET LANGUAGE TO xxxx,
EXTERNAL HB_CODEPAGE_xxxx
REQUEST HB_SETCODEPAGE
HB_SETCODEPAGE('xxxx')
...
and others...

All are useful and adequate functions / commands, no doubt.

But sometime inefficient for me :(

And, I'm using my own case convert function :)

By changing two national character set layout, usable for all languages.

f.e. :

Code: Select all

DEFINE TEXTBOX xxx
     ...
     ON CHANGE { || this.value := NatChCas( this.value ) }
     ...
END TEXTBOX
Enjoy !

--

Esgici
NatChCas.zip
National case converter
(1008 Bytes) Downloaded 167 times

Re: ÍNDICE o INDICE / Upper or Lower ?

Posted: Wed Oct 19, 2011 12:15 pm
by esgici
esgici wrote:...
I'm using my own case convert function :)
Added : NatUpper() and NatLower() functions.

Enjoy !

--

Esgici
NatChCas2.zip
National Case Convert - 2 ( 3 functions)
(1.31 KiB) Downloaded 221 times