GRID problem with DBF

Moderator: Rathinagiri

Post Reply
User avatar
asacaric
Posts: 9
Joined: Mon May 05, 2014 1:12 pm
Location: Croatia

GRID problem with DBF

Post by asacaric »

In this simple app, GRID control shows one letter (usually H or X) instead of entire DBF field.
There is no rule, sometimes it is in first column, sometimes second, sometimes both...

HMG (32 bits) 3.3.1
I've tried other DBF's, alternative GRID control, COLUMNCONTROLS... but result is the same.

Please help :(

Code: Select all

    @ 0,0 grid grid_artikli;
      WIDTH 600;
      HEIGHT 500;
      HEADERS {'SIFRA','BARCODE','NAZIV','SIFROBED'} ;
      COLUMNFIELDS { 'SIFROBE','SIFROBEB','NAZIV','SIFROBED' } ;
      WIDTHS {90,90,200,90};
      ROWSOURCE "ARTIKLI" ;
      on dblclick f_artikli();
      FONT 'ARIAL' SIZE 8
Attachments
TestGrid.zip
(2.86 KiB) Downloaded 233 times
EduardoLuis
Posts: 682
Joined: Tue Jun 04, 2013 6:33 pm
Location: Argentina

Re: GRID problem with DBF

Post by EduardoLuis »

Hi asacaric

I've test your sample, and works fine, as you see on attached *.JPG
Attachments
YOUR_SAMPLE.jpg
YOUR_SAMPLE.jpg (195.23 KiB) Viewed 4552 times
User avatar
asacaric
Posts: 9
Joined: Mon May 05, 2014 1:12 pm
Location: Croatia

Re: GRID problem with DBF

Post by asacaric »

Hi EduardoLuis, my PC@home works also fine.
This is what I get on my PC@job and that makes me crazy:
Attachments
SCRSHT.jpg
SCRSHT.jpg (112.28 KiB) Viewed 4538 times
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: GRID problem with DBF

Post by Javier Tovar »

Hola asacaric,

Ya vi tu muestra y a mi también me pasa lo mismo que a ti, pero ya encontre el "error", lo que pasa es que tu tienes tu HMG en ANSI o Unicode??? y tu pones "SET CODEPAGE TO UNICODE", si cambias esa linea por esta: "SET CODEPAGE TO SPANISH", todo resuelto!

Tambien recuerda que la codificasión de tu archivo esta en ANSI., y a lo mejor tu HMG esta en Unicode y es ahi el conflicto.

Si utilizas HMG Unicode, entonces tus *.PRG deben de estar codificados en Unicode y debes de poner SET CODEPAGE TO UNICODE.

Si utilizas HMG ANSI, entonces tus *.PRG deben de estar codificados en ANSI y debes de poner SET CODEPAGE TO Spanish.


(Yo tengo HMG.3.3.1 en ANSI, *.prg en ANSI y SET CODEPAGE TO Spanish. y asi si me trabajo bien tu ejemplo!)


Saludos.

P.D.: Espero haberte ayudado.

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Hello asacaric,

I've seen your show and I also feel the same to you, but I found the "error", what happens is that you have your HMG in ANSI or Unicode ??? and you put "SET TO UNICODE CODEPAGE", if you change that line to this: "SET CODEPAGE TO SPANISH" all figured out!

Codificasión Also remember that your file is in ANSI., And maybe your HMG is in Unicode and hence the conflict.

If you use Unicode HMG, then your * .PRG must be encoded in Unicode and have to put SET TO UNICODE CODEPAGE.

If you use ANSI HMG, then your * .PRG must be encoded in ANSI and need to put SET TO CODEPAGE Spanish.


(I have HMG.3.3.1 in ANSI, ANSI .prg * CODEPAGE TO SET and Spanish., And if I work so well your example!)


Error.jpg
Error.jpg (154.39 KiB) Viewed 4535 times

Greetings.

P.D .: hope I helped.
User avatar
asacaric
Posts: 9
Joined: Mon May 05, 2014 1:12 pm
Location: Croatia

Re: GRID problem with DBF

Post by asacaric »

Hello Javier, it seems that you're right :shock:

I'm using @work and @home the same HMG unicode 3.3.1, but functions return:

@home
hmg_supportunicode() .T.
hmg_charsetname() UNICODE
hmg_iscurrentcodepageunicode() .T.

@work
hmg_supportunicode() .F.
hmg_charsetname() ANSI
hmg_iscurrentcodepageunicode() .F.

How this can be? Is the reason some of DEMOs from included SAMPLES that I've tried @work and not @home?
How can I set it to back to UNICODE by default?

BTW, I'm starting to rewrite all my business apps from Clipper to HMG and I want to do it right.
Is UNICODE the right choice?

Thank you all!!!
User avatar
mol
Posts: 3723
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: GRID problem with DBF

Post by mol »

rebuild your hmg library using buildlib.bat
User avatar
asacaric
Posts: 9
Joined: Mon May 05, 2014 1:12 pm
Location: Croatia

Re: GRID problem with DBF

Post by asacaric »

Ok, mr. Marek, that's it! THANKS!
I can't tell you all how happy I am now :) :D ;)

Case closed :)

And what about ANSI/UNICODE? Is UNICODE everybody's future?
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: GRID problem with DBF

Post by Javier Tovar »

Hola,

En el Notepad++, hay un menú que dice "Codificación" y ahí puedes elegir UTF-8 (que es Unicode) O ANSI, lo seleccionas y listo. Solo cuando te traigan un archivo nuevo tienes que fijarte en que codificación esta, y el el mismo menú viene para convertirlo en un formato o en otro.

Lo que yo sé es que si NO necesitas caracteres especiales como para escribir en árabe, por ejemplo, NO necesitas Unicode solo ANSI. Si tus programas que tienes de Clipper están bien, entonces creo que no necesitas Unicode, solo ANSI. Yo batallo mucho con Unicode, ya que como soy de México aquí sólo los idiomas que más se utilizan es el español y el ingles, entonces no necesito Unicode solo ANSI.

Aquí la información que me traen en ficheros *.DBF y en Excel están guardados con ANSI, entonces para trabajar con Unicode tengo que transformar toda la información en Unicode lo cual es un trabajo extra que lo he valorado y no vale la pena, con ANSI no tengo que hacer nada extra, solo copio la información al sistema y listo!

Espero haberte ayudado! :)

Espero que te haya ayudado a aclarar tus dudas.
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Hi there,

In Notepad ++, there is a menu that says "Encoding" and there you can choose UTF-8 (which is Unicode) or ANSI, so choose and go. Only when you bring a new file you have to look at that coding this, and the same menu is to convert it into a format or another.

What I know is that if you DO NOT need to write special characters in Arabic, for example, NO need only ANSI Unicode. If you have your programs Clipper are fine, then I think you do not need Unicode, ANSI only. I battle a lot with Unicode, because as I am from Mexico here only the most commonly used languages ​​are Spanish and English, then I do not need ANSI Unicode only.

Here I bring the information in files * DBF and Excel are saved in ANSI, then to work with Unicode have to transform all information on Unicode which is extra work that I have valued and not worth with ANSI no I have to do anything extra, just copy the information into the system and go!

Hope that helps!
User avatar
mol
Posts: 3723
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: GRID problem with DBF

Post by mol »

Unicode is unusable /softly, hard to use/ with .dbf files, but it's my private opinion only.

Nice to help you :-)

Ps. I love Croatia, I was on holiday there this month... :-D
EduardoLuis
Posts: 682
Joined: Tue Jun 04, 2013 6:33 pm
Location: Argentina

Re: GRID problem with DBF

Post by EduardoLuis »

Hi Mol & Javier:

I agree with both of you, i use HMG & *.dbf only in ANSI.-
I agree also with you MOL about unusability of UNICODE with *.dbf.-
But take in count that HMG has become universal, so users from countries with special char set must use UNICODE codification to perform HMG developes, and specially those who performs MySql.-
I'm a devote user of *.dbf tables, i've been programing using *.dbf for more than 30 years, so for me is like speaking mother's language.- Other members prefer's SQL.-
With regards.-
Eduardo
Post Reply