PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → [WD20] Input Mask Problem
[WD20] Input Mask Problem
Iniciado por guest, 08,mar. 2016 00:26 - 3 respuestas
Publicado el 08,marzo 2016 - 00:26
I have an edit field that is numeric. The display mask is set to "Same mask as the input". The input mask is set to "99.9 %%". This mask works fine. However, if the user toggles a different control I change the input mask using the maskSystemCurrency constant.
EDT_NoName1..InputMask = maskSystemCurrency That also works fine, but if the user toggles the control again I switch the input mask back to "99.9 %%".
EDT_NoName1..InputMask = "99.9 %%" At this point the edit field starts displaying as 9,9 % instead of 99% and it will not let me include a decimal place.

Thoughts?
Publicado el 08,marzo 2016 - 12:55
Hi Curtis

I generally don't change input masks so I don't have any direct answer. However, there is an easy work around, by using two input fields with different masks and making visible the one you need.

Best regards
Publicado el 08,marzo 2016 - 14:40
Hi Curtis

Here's what I tried to address your problem.

1. Define a string variable MyMask to store the original mask.

2. BEFORE EDT_NoName1..InputMask = maskSystemCurrency
I inserted: MyMask=EDT_NoName1..InputMask

3. Then INSTEAD OF EDT_NoName1..InputMask = "99.9 %%"
I used EDT_NoName1..InputMask = MyMask

It seems to work fine.

- Mike H.
Publicado el 08,marzo 2016 - 15:51
Two good work arounds. Thanks guys. I went ahead and used the MyMask variable and it stored the initial input mask as "99,9 %%" and worked when I set the edit field's input mask to MyMask. Comma's and periods get confusing when dealing with masks.