Entering numericals via num pad in Germany

Topic Specific Tutorials and Tips.

Moderator: Rathinagiri

Post Reply
fredmr
Posts: 3
Joined: Thu Aug 21, 2008 8:34 am

Entering numericals via num pad in Germany

Post by fredmr »

Hi folks,

first of all a big "thank you" to the developers of HMG and all other involved people !!!

Currently I'm trying to solve a problem associated with a german characteristic:
In Germany numeric values have the decimal separator ',' and not '.' like in most
parts of the world. The german thousands separator is "." and not "," like usual.

Example:

in Germany: 1.234.567,89
in USA: 1,234,567.89

So german keyboard have a ',' on the num pad instead of '.'

I'm now playing around with textboxes and its inputmask parameter: When I
define the appropiate texbox property als numeric, I have to use the international
way of entering values, for example via inputmask "999.00". Germans are not
able to use the ',' of their num pads. :-(

When I define the textbox as a character based one I'm able to define an
inputmask like "999.999,99" but I'll have to eval any of such textboxes and to
convert those strings into numericals... :-(

Is there any solution for this behaviour ? Is it possible to tell HARBOUR to use
the german separators ? 'Set Language To German' doesn't seem to work for
this situation...

Thank you in advance,
Fred...
fredmr
Posts: 3
Joined: Thu Aug 21, 2008 8:34 am

Re: Entering numericals via num pad in Germany

Post by fredmr »

Hi again,

seeing that noone can help has taken me to have a look into the
user components example. When trying to compile 'demo.prg'
in 'C:\HMG\SAMPLES\USER_COMPONENTS' I get the following
errors:

Harbour 1.0.0 Intl. (Rev. 9175)
Copyright (c) 1999-2008, http://www.harbour-project.org/
Compiling 'demo.prg'...
demo.prg(22) Error E0030 Syntax error: "syntax error at '.'"
demo.prg(23) Error E0030 Syntax error: "syntax error at '.'"
demo.prg(24) Error E0030 Syntax error: "syntax error at '.'"
demo.prg(25) Error E0030 Syntax error: "syntax error at '.'"
demo.prg(34) Error E0030 Syntax error: "syntax error at '@'"
Compiling module 'MyButton.Prg'...
5 errors

No code generated
gcc: demo.c: No such file or directory
gcc: no input files
gcc: demo.o: No such file or directory
C:\HMG\SAMPLES\USER_COMPONENTS\demo.c konnte nicht gefunden werden
C:\HMG\SAMPLES\USER_COMPONENTS\demo.o konnte nicht gefunden werden


So what's wrong with this example ?

TIA,
Fred...
User avatar
gfilatov
Posts: 1058
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: Entering numericals via num pad in Germany

Post by gfilatov »

fredmr wrote:...
When trying to compile 'demo.prg'
in 'C:\HMG\SAMPLES\USER_COMPONENTS' I get the following
errors:

...
So what's wrong with this example ?
Fred,

Take a look for readme.txt at your folder C:\HMG\SAMPLES\USER_COMPONENTS:
HMG USER COMPONENTS SAMPLE
--------------------------

To run this sample, please add the following text to c:\hmg\include\usrinit.ch

#define BASEDEF_MYBUTTON

#xcommand @ <row>,<col> MYBUTTON <name> ;
OF <parent> ;
CAPTION <caption> ;
ACTION <action> ;
=>;
_DefineMyButton(<"name">,<row>,<col>,<caption>,<{action}>,<"parent">)

#undef BASEDEF_MYBUTTON

And ADD the following to c:\hmg\include\i_usrsoop.ch without leaving blank
lines between the text currently in that file and this.

#define SOOP_MYBUTTON ;;
#xtranslate <Window> . \<Control\> . Disable => Domethod ( <"Window">, \<"Control"\> , "Disable" ) ;;
#xtranslate <Window> . \<Control\> . Enable => Domethod ( <"Window">, \<"Control"\> , "Enable" ) ;;
#xtranslate <Window> . \<Control\> . Handle => GetProperty ( <"Window">, \<"Control"\> , "Handle" ) ;;
#xtranslate <Window> . \<Control\> . Handle := \<v\> => SetProperty ( <"Window">, \<"Control"\> , "Handle" , \<v\> ) ;;
#undef SOOP_MYBUTTON ;;
I hope that give you an ideas.
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
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: Entering numericals via num pad in Germany

Post by Rathinagiri »

Hi,

Please give your code also. Then only we can see what would be the error.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
fredmr
Posts: 3
Joined: Thu Aug 21, 2008 8:34 am

Re: Entering numericals via num pad in Germany

Post by fredmr »

Thank you !

It bas been my fault: I didn't change the usrinit.ch
I didn't carefully read the readme.txt :-(

Currently there's no source code; I only wanted to see
the example, but due to the missing include I couldn't
work.

Thank you again,
Fred...
Post Reply