PICTURE for only Numbers and Chars
PICTURE for only Numbers and Chars
Hi Guis,
I would like to know if is there some kind of GET Picture that I could specify to accept only Chars and numbers(Ex: 01234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ) without alows the user to digit special chars, Is there ?
I would like to know if is there some kind of GET Picture that I could specify to accept only Chars and numbers(Ex: 01234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ) without alows the user to digit special chars, Is there ?
Re: PICTURE for only Numbers and Chars
I found out the parameter N. IF I use PICTURE "NNNNN" it's working, but if I use PICTURE "@N" don't work. Do you know why ?
Re: PICTURE for only Numbers and Chars
Veja se ajuda:
Code: Select all
LOCAL cLetraNum := SPACE(39)
@ 1, 6 GET oGet VAR cLetraNum OF oDlg SIZE 160, 10 COLOR "W/G" ;
PICTURE "@KR 99999999999-!!!!!!!!!!!!!!!!!!!!!!!!!!"
João Santos - São Paulo - Brasil
Re: PICTURE for only Numbers and Chars
Karinha,
Na mesma posição eu preciso aceitar letras ou números. No caso do seu exemplos, no começo só aceita números e no final qualquer coisa. No meu caso, caracteres especiais não devem ser aceitos, mas em qualquer posição, pode-se digitar uma letra ou um numero. Entendeu ?
Na mesma posição eu preciso aceitar letras ou números. No caso do seu exemplos, no começo só aceita números e no final qualquer coisa. No meu caso, caracteres especiais não devem ser aceitos, mas em qualquer posição, pode-se digitar uma letra ou um numero. Entendeu ?
- Silvio.Falconi
- Posts: 4956
- Joined: Thu Oct 18, 2012 7:17 pm
Re: PICTURE for only Numbers and Chars
perhpas it need a a valid function....
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
Re: PICTURE for only Numbers and Chars
Or just that PICTURE "@N" Works !
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Re: PICTURE for only Numbers and Chars
Here is a link to the Clipper guide explaining all the @ Get picture options.
https://www.itlnet.net/programming/prog ... aee8c.html
https://www.itlnet.net/programming/prog ... aee8c.html
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Re: PICTURE for only Numbers and Chars
In Brasil, we use to say... "If everything goes wrong, see the manual"
James just posted the manual...
@ 2, 8 GET cAlpNum OF oDlg SIZE 60, 10 PICTURE "NNNNNNNNNN"
(of course, cAlpNum must be a character variable)
Regards, Euclides
James just posted the manual...
@ 2, 8 GET cAlpNum OF oDlg SIZE 60, 10 PICTURE "NNNNNNNNNN"
(of course, cAlpNum must be a character variable)
Regards, Euclides
Re: PICTURE for only Numbers and Chars
Thank You James,
I have already known this content. I didn't undestand is why I can do PICTURE "@!" AND can't to do PICTURE "@N". Do you know ?
I have already known this content. I didn't undestand is why I can do PICTURE "@!" AND can't to do PICTURE "@N". Do you know ?
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Re: PICTURE for only Numbers and Chars
Vilian,
Define "special characters." Do you mean characters that appear on the keyboard that are not letters or numbers (like punctuation)? Or do you mean special characters that are not on the keyboard?
James
I'm not sure I understand. Both work for me--the only difference is that @N allows lower case letters. Both allow other characters like punctuation.I didn't understand is why I can do PICTURE "@!" AND can't to do PICTURE "@N". Do you know ?
Define "special characters." Do you mean characters that appear on the keyboard that are not letters or numbers (like punctuation)? Or do you mean special characters that are not on the keyboard?
James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Re: PICTURE for only Numbers and Chars
James,
IF we define PICTURE "NNNN" the user will can enter only one of these chars 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ, any other will not be accepted.
IF we define PICTURE "@N" any char is accepted, but I would like to have the same behavior of PICTURE "NNNN"
IF we define PICTURE "NNNN" the user will can enter only one of these chars 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ, any other will not be accepted.
IF we define PICTURE "@N" any char is accepted, but I would like to have the same behavior of PICTURE "NNNN"
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Re: PICTURE for only Numbers and Chars
If "@NNN" does what you want, then what is the problem? Maybe you don't want to specify the length?
Actually, "NNNN" also allows lower case letters too. Did you realize that?
Actually, "NNNN" also allows lower case letters too. Did you realize that?
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
- Silvio.Falconi
- Posts: 4956
- Joined: Thu Oct 18, 2012 7:17 pm
Re: PICTURE for only Numbers and Chars
oGet:bChange := { | nKey,nFlag,oB|(Chr(nKey)$"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ")}
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
Re: PICTURE for only Numbers and Chars
Yes James, but the lower case I can surround through the the property of the resource.James Bott wrote:If "@NNN" does what you want, then what is the problem? Maybe you don't want to specify the length?
Actually, "NNNN" also allows lower case letters too. Did you realize that?
Re: PICTURE for only Numbers and Chars
Thank you Silvio,Silvio.Falconi wrote:oGet:bChange := { | nKey,nFlag,oB|(Chr(nKey)$"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ")}
This is what I will do, but directly in TGET class.