TEXTBOX behaviour

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
serge_girard
Posts: 3162
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

TEXTBOX behaviour

Post by serge_girard »

Hello,

I see strange behaviour with this code

Code: Select all

      DEFINE TEXTBOX TB_MBEGREK
         ROW 40
         COL 120
         HEIGHT 25
         WIDTH 120
         VALUE 0			// or value ''
         TOOLTIP "Enter Digits 0 to 9"
         INPUTMASK '999999'
         FONTNAME "Arial"
         FONTSIZE 10
         FONTBOLD .F.
         ON GOTFOCUS  Form_Grootboek_PDF.TB_MBEGREK.BackColor := WHITE  
         ON LOSTFOCUS Form_Grootboek_PDF.TB_MBEGREK.BackColor := SILVER 
         BACKCOLOR SILVER  
         FONTCOLOR BLACK
      END TEXTBOX 

When running this the value is sometimes 12 spaces.. Am I missing something or is it a little bug?

Serge
There's nothing you can do that can't be done...
EduardoLuis
Posts: 682
Joined: Tue Jun 04, 2013 6:33 pm
Location: Argentina

Re: TEXTBOX behaviour

Post by EduardoLuis »

Hi Serge:

It's missing this property:

NUMERIC IMPUTMASK '999999'

optional

NUMERIC IMPUTMASK '999,999' FORMAT 'E' to show a dot instead a comma

With regards.
Eduardo
User avatar
serge_girard
Posts: 3162
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: TEXTBOX behaviour

Post by serge_girard »

Thanks Eduardo, but that gives: Syntax error...
NUMERIC INPUTMASK '9999'

Serge
There's nothing you can do that can't be done...
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: TEXTBOX behaviour

Post by srvet_claudio »

Try added

DATATYPE NUMERIC
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: TEXTBOX behaviour

Post by mol »

But datatype numeric excludes leading zeros if he need them to input
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: TEXTBOX behaviour

Post by Rathinagiri »

Marek, in that case you need to get the value in character string.

VALUE '0'

Can be used I think.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
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: TEXTBOX behaviour

Post by Rathinagiri »

serge_girard wrote: Tue Feb 21, 2017 1:51 pm Thanks Eduardo, but that gives: Syntax error...
NUMERIC INPUTMASK '9999'

Serge
NUMERIC .t.
INPUTMASK '9999'
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
serge_girard
Posts: 3162
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: TEXTBOX behaviour

Post by serge_girard »

That works, but I want a CHAR field which only may contains 0-9 (a numeric code actually: 000000-999999).
What I have now (see initial coding) is working fine, EXCEPT it looks like the value-clause was set to space(6) and focosing on it sets cursor at the end and then you must select input before you can enter a new value...

Serge
There's nothing you can do that can't be done...
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: TEXTBOX behaviour

Post by mol »

serge_girard wrote: Tue Feb 21, 2017 3:12 pm That works, but I want a CHAR field which only may contains 0-9 (a numeric code actually: 000000-999999).
What I have now (see initial coding) is working fine, EXCEPT it looks like the value-clause was set to space(6) and focosing on it sets cursor at the end and then you must select input before you can enter a new value...

Serge
I have the same problem in one of my app
User avatar
serge_girard
Posts: 3162
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: TEXTBOX behaviour

Post by serge_girard »

Marek, That makes two!
There's nothing you can do that can't be done...
Post Reply