inputmask - content lenght

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

inputmask - content lenght

Post by l3whmg »

Hi friends,
is there someone can help me to better understand about INPUTMASK?
I've used this (piece) of code

Code: Select all

DEFINE TEXTBOX <ControlName>
ROW ...
COL ...
....
INPUTMASK '999-999-999'
ONENTER TestField()
I don't insert any charcater and then I've pressed <Enter>. Inside "TestField()" I've used this code

Code: Select all

MsgStop(Hb_ValToExp(LEN(ALLTRIM(FormName.ControlName.Value))))
and I obtain 5 (mambo number... :lol: ). Why? I thought: I must obtain 11 - 2 = 9.
The situation it's the same if (but I think it's wrong code) I add

Code: Select all

MAXLENGHT
property to the control.

Many thanks
Luigi from Italy
www.L3W.it
User avatar
Alex Gustow
Posts: 290
Joined: Thu Dec 04, 2008 1:05 pm
Location: Yekaterinburg, Russia
Contact:

Re: inputmask - content lenght

Post by Alex Gustow »

Hi Luigu!
Not MAXLENGHT - but MAXLENGTH is correct (I think)

Or - if you wrote in prog correctly: "MAXLENGTH"... I don't understand why it's not work right :|
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: inputmask - content lenght

Post by l3whmg »

Hi Alex,
many thank to you for fast replay. About MAXLENGHT He is (I am) a bad english writer :lol:
My problem it's to establish if a user enter something or not: for this reason I've used

Code: Select all

LEN(ALLTRIM(...
and I've found number 5 when I don't insert anything.
In other words: 11 charcaters - 2 separator is 9. If I test number 2 I know that user don't insert anything.

I hope you can understand my poor English :oops:

With Best Regards
Luigi from Italy
www.L3W.it
Post Reply