ÍNDICE o INDICE

HMG en Español

Moderator: Rathinagiri

User avatar
Czarny_Pijar
Posts: 172
Joined: Thu Mar 18, 2010 11:31 pm
Location: 19.2341 E 50.2267 N

Re: ÍNDICE o INDICE

Post by Czarny_Pijar » Sat Apr 03, 2010 8:14 pm

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!

User avatar
esgici
Posts: 4508
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 385 times
Been thanked: 111 times
Contact:

Post by esgici » Sat Apr 03, 2010 8:29 pm

Hi Czarny

Are you sure that this way is adequate ?

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

Regards

--

Esgici
Viva INTERNATIONAL HMG :D

User avatar
esgici
Posts: 4508
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 385 times
Been thanked: 111 times
Contact:

Post by esgici » Tue Oct 18, 2011 10:51 pm

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 122 times
Viva INTERNATIONAL HMG :D

User avatar
esgici
Posts: 4508
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 385 times
Been thanked: 111 times
Contact:

Post by esgici » Wed Oct 19, 2011 12:15 pm

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 178 times
Viva INTERNATIONAL HMG :D

Post Reply