Comma and decimal point as a decimal separator

Creative ideas/suggestions for HMG

Moderator: Rathinagiri

radohabjan
Posts: 99
Joined: Mon Nov 30, 2009 7:17 am
Location: Slovenia
Contact:

Comma and decimal point as a decimal separator

Post by radohabjan »

Hello friends,

I changed my old clipper programs with HMG and works perfectly except one problem: in Clipper (GET) you can use comma or decimal point ( same fiunctionality ) as a decimal separator , with HMG (TEXTBOX) is this possible just with decimal point. Slovenian keyboard has on numeric key pad instead of decimal point comma, so user can not use numeric key pad as normal.

It is possible to get this functionality in new releases ? Or is ther any other solution ?

Best regards Rado
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Re: Comma and decimal point as a decimal separator

Post by Pablo César »

Hi Rado,

I think you means a mask as format in a PICTURE. I believe there is already this format in pictures, please read this post: http://hmgforum.com/viewtopic.php?f=20& ... hilit=mask

And take a look in C:\hmg.3.0.35\SAMPLES\INPUTMASK.1 (last it is with comma)
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
radohabjan
Posts: 99
Joined: Mon Nov 30, 2009 7:17 am
Location: Slovenia
Contact:

Re: Comma and decimal point as a decimal separator

Post by radohabjan »

Hello

as Roberto said :

The mask must ALWAYS specify decimals as points and thousand separators as commas.
When you use FORMAT "E", the comma and point are inverted for DISPLAY PURPOSES ONLY.
To enter the data you must always use POINT as decimal separator.My native tongue is Spanish, I use Spanish language Windows version and I have a Spanish keyboard.
My Spanish keyboard has a point as decimal separator in the numeric keypad.


Slovenian language Windows and Slovenian keyboard has a COMMA instead of POINT in the numeric keypad. To enter the data you must always use POINT as decimal separator. In Clipper you can use both.

Best regards Rado
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: Comma and decimal point as a decimal separator

Post by l3whmg »

Hi Rado,
thi is a common problem (today) with HMG. There is an old request (from me and other) to solve this problem; the answer from Roberto was ASAP.
Best regard
Luigi from Italy
www.L3W.it
qres
Posts: 2
Joined: Wed Feb 02, 2011 8:18 am
Location: Torun (Poland)

Re: Comma and decimal point as a decimal separator

Post by qres »

Hi
The problem can be solved:)
at the beginning of the declaration:

Code: Select all

#xcommand ON KEY  DELNUM [ OF <parent> ] ACTION <action> ;
=> ;
_DefineHotKey ( <"parent"> , 0 , VK_DECIMAL , <{action}> )

#xcommand RELEASE KEY DELNUM OF <parent> ;
=> ;
_ReleaseHotKey ( <"parent"> , 0 , VK_DECIMAL   )

#xcommand STORE KEY DELNUM OF <parent> TO <baction> ;
=> ;
<baction> := _GetHotKey ( <"parent"> , 0 , VK_DECIMAL   )
then in the definition window:

Code: Select all

ON KEY DELNUM ACTION  _PushKey(190)
and the problem solved :)
Good luck ....
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: Comma and decimal point as a decimal separator

Post by l3whmg »

Hi Qres,
many thanks! I'll try.

Cheers
Luigi from Italy
www.L3W.it
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Comma and decimal point as a decimal separator

Post by mol »

Great solution!
It works OK in TEXTBOXes, but... when I need to edit grid cell, it doesn't work. Rathi should help here.

Best regards, Marek
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Comma and decimal point as a decimal separator

Post by mol »

As I remember, new window is created during edition of grid. I think, this temporary window should inherit all ON KEY ACTION... settings.
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: Comma and decimal point as a decimal separator

Post by Rathinagiri »

As you said, a new window is created for temporary editing. We have to grab the window handle of the temporary window.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Comma and decimal point as a decimal separator

Post by mol »

I want to refresh this topic and put here a small program, which can be very useful for all who needs to swap coma and dot on numeric keypad.
please download it from http://www.molsystemy.pl/faktury/coma2dot.zip

I think Grigori Filatov can do such a program without any problems...

Grigori, please look at this sample.


You can start it:
coma2dot -k
for "dot mode"
Attachments
coma2dot.zip
(13.82 KiB) Downloaded 461 times
Post Reply