Pregunta por cierto formato en INPUTMASK de TEXTBOX

HMG en Español

Moderator: Rathinagiri

Post Reply
citro
Posts: 52
Joined: Wed Dec 22, 2010 3:45 pm

Pregunta por cierto formato en INPUTMASK de TEXTBOX

Post 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?
Antonio
Sistemas
Resipol
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Pregunta por cierto formato en INPUTMASK de TEXTBOX

Post 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
Viva INTERNATIONAL HMG :D
citro
Posts: 52
Joined: Wed Dec 22, 2010 3:45 pm

Re: Pregunta por cierto formato en INPUTMASK de TEXTBOX

Post 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'
Antonio
Sistemas
Resipol
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: Pregunta por cierto formato en INPUTMASK de TEXTBOX

Post 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
Post Reply