Page 1 of 1

Pregunta por cierto formato en INPUTMASK de TEXTBOX

Posted: Fri Feb 28, 2014 1:36 pm
by citro
En un TEXTBOX tengo que ingresar un valor que puede tener estas características:

cValor:="000000" o cValor:="ZZ1234" o cValor:="ZZXXXX"

y el INPUTMASK tendria que ser algo como este código de Clipper

@ 10,10 get cValor picture "@R !!-!!!!"

si fueran solo números el INPUTMASK seria

@ 10,10 TEXTBOX txtValor ;
VALUE cValor ;
WIDTH 70 ;
INPUTMASK "99-9999"

y funciona bien, pero el tema es que no encuentro dentro de las propiedades del INPUTMASK un valor para ingresar caracteres alfanumericos para este formato.¿ Es posible eso?

Re: Pregunta por cierto formato en INPUTMASK de TEXTBOX

Posted: Fri Feb 28, 2014 1:56 pm
by esgici
citro (via Google) wrote:In a textbox I have to enter a value that can have these characteristics:

cValor: = "000000" or cValor: = "ZZ1234" or cValor: = "ZZXXXX"

INPUTMASK and would have to be something like this code Clipper

@ 10,10 get cValor picture "@ R -!!"

if numbers were the only serious INPUTMASK

@ 10,10 TEXTBOX txtValor;
VALUE cValor;
WIDTH 70;
INPUTMASK "99-9999"

and it works fine, but the issue is that I find within INPUTMASK properties to enter a value for this format alphanumeric characters. Is that possible?
HMG Doc wrote:InputMask String (Non-Numeric Textbox):
9 Digits
A Alphabetic Characters
! Converts an alphabetic character to uppercase

(All other characters ar included in text in the position indicated by the mask)
So, did you tried

Code: Select all

INPUTMASK "AA-AAAA" 
Please look at TEXTBOX text_5 in ~hmg\SAMPLES\Controls\TextBox\INPUTMASK.2\demo.prg for a more complex example.

Happy HMG'ing :D

Re: Pregunta por cierto formato en INPUTMASK de TEXTBOX

Posted: Fri Feb 28, 2014 3:54 pm
by citro
with "AA-AAAA" only allows me to enter letters, if I use "!!-!!!!" The TextBox appears with a minus character eg.

cValor: = "000000"
appear as "00-000"

In Example 5, said masks are fixed format, that is,

INPUTMASK 'AAA-99999 / A'

The first 3 characters are alphabetic, but if I want to enter numbers or vice versa

INPUTMASK '999-AAAA / A'

Re: Pregunta por cierto formato en INPUTMASK de TEXTBOX

Posted: Fri Feb 28, 2014 4:54 pm
by Javier Tovar
Hi Citro,

For a variable mask would be advisable to make a function in ONCHANGE, to verify that each pulse is one of the formats you need. I believe! :D

Regards