Problema con combosearchbox/ problem combosearchbox

HMG en Español

Moderator: Rathinagiri

Leopoldo Blancas
Posts: 388
Joined: Wed Nov 21, 2012 7:14 pm
Location: México

Problema con combosearchbox/ problem combosearchbox

Post by Leopoldo Blancas »

Hola a todos...

Estando practicando con combosearchbox no me ejecuta mi aplicación... solo cambie de Archivo...
Gracias
Polo
*-------------------------------------------------------------------------------------------------------------
Hi all ...

While practicing with combosearchbox I run my application ... File change only ...
thanks
Polo
Leopoldo Blancas
Posts: 388
Joined: Wed Nov 21, 2012 7:14 pm
Location: México

Re: Problema con combosearchbox/ problem combosearchbox

Post by Leopoldo Blancas »

el archivo...
Attachments
aa.rar
(14.61 KiB) Downloaded 329 times
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Problema con combosearchbox/ problem combosearchbox

Post by Rathinagiri »

Hi,

I do have come across this problem.

just add these lines before asort()

Code: Select all

       for i := 1 to len( aMunicipios )
          aMunicipios[ i ] := alltrim( aMunicipios[ i ] )
       next i
I think Esgici can solve the problem once for all. I will also check.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Problema con combosearchbox/ problem combosearchbox

Post by esgici »

rathinagiri wrote:...
I think Esgici can solve the problem once for all. ...
Sorry ...

I can't understood Spanish :(

Especially code written with Spanish identifiers and abbreviations :(
Viva INTERNATIONAL HMG :D
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Re: Problema con combosearchbox/ problem combosearchbox

Post by Pablo César »

esgici wrote:Sorry ...

I can't understood Spanish :(

Especially code written with Spanish identifiers and abbreviations :(
But Polo has written in English too in his message.

What Mr. Rathinagiri is indicating is for you Esgici to apply Alltriming in arrays before processing. This I think could be done in your combosearchbox source code.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Problema con combosearchbox/ problem combosearchbox

Post by esgici »

Pablo César wrote:...
But Polo has written in English too in his message.
OK amigo,

Could you please explain to me what's the problem of Polo in this thread (combobox) ?
Viva INTERNATIONAL HMG :D
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Re: Problema con combosearchbox/ problem combosearchbox

Post by Pablo César »

Hi dear Esgici,

In order to work (in this Polo's case), after reading from lst file, which contains al lot of spaces in the file, probably by exporting from a dbf, then needing to apply procedure of the Rathinagiri indications:

Code: Select all

aMunicipios := HB_ATOKENS( MEMOREAD( "Municipios.lst" ),   CRLF )
for i := 1 to len( aMunicipios )
     aMunicipios[ i ] := alltrim( aMunicipios[ i ] )
next i
ASORT( aMunicipios )
After this, it's working pretty well. But needs to make Alltriming in each elements.

So, user before loading at combosearchbox, need to remove spaces. But our suggestion is to make this (as garantee) making in your combsearchbox source code. If you agree, ofcourse.
My other sugegestion is to implement in your source code a function which can read from a dbf and applying alreading the AlTrim in each element when constructing the array one. What do you think ?
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Re: Problema con combosearchbox/ problem combosearchbox

Post by Pablo César »

Amigo Esgici, if you do not what to make implements in your code, Polo only need to replace this line:

aMunicipios := HB_ATOKENS( MEMOREAD( "Municipios.lst" ), CRLF )

by these two lines:

Local aMunicipios:={}

AEval( hb_atokens( MEMOREAD( "Municipios.lst" ), CRLF ), { |cLine| AaDd( aMunicipios, AllTrim( cLine ) ) } )


Then it solves his problem.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Problema con combosearchbox/ problem combosearchbox

Post by esgici »

Olá Pablo

Are you sure that problem is trailing spaces ?
Viva INTERNATIONAL HMG :D
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Problema con combosearchbox/ problem combosearchbox

Post by Rathinagiri »

Yes Esgici. It is because of trailing spaces.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
Post Reply