PICTURE for only Numbers and Chars

User avatar
vilian
Posts: 795
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

PICTURE for only Numbers and Chars

Post by vilian »

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 ?
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
Posts: 795
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Re: PICTURE for only Numbers and Chars

Post by vilian »

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 ?
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: PICTURE for only Numbers and Chars

Post by karinha »

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
User avatar
vilian
Posts: 795
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Re: PICTURE for only Numbers and Chars

Post by vilian »

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 ?
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: PICTURE for only Numbers and Chars

Post by Silvio.Falconi »

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
User avatar
vilian
Posts: 795
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Re: PICTURE for only Numbers and Chars

Post by vilian »

Or just that PICTURE "@N" Works !
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
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

Post by James Bott »

Here is a link to the Clipper guide explaining all the @ Get picture options.

https://www.itlnet.net/programming/prog ... aee8c.html
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
User avatar
Euclides
Posts: 144
Joined: Wed Mar 28, 2007 1:19 pm

Re: PICTURE for only Numbers and Chars

Post by Euclides »

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
User avatar
vilian
Posts: 795
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Re: PICTURE for only Numbers and Chars

Post by vilian »

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 ?
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
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

Post by James Bott »

Vilian,
I didn't understand is why I can do PICTURE "@!" AND can't to do PICTURE "@N". Do you know ?
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.

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
User avatar
vilian
Posts: 795
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Re: PICTURE for only Numbers and Chars

Post by vilian »

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"
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
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

Post by James Bott »

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?
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: PICTURE for only Numbers and Chars

Post by Silvio.Falconi »

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
User avatar
vilian
Posts: 795
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Re: PICTURE for only Numbers and Chars

Post by vilian »

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?
Yes James, but the lower case I can surround through the the property of the resource.
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
Posts: 795
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Re: PICTURE for only Numbers and Chars

Post by vilian »

Silvio.Falconi wrote:oGet:bChange := { | nKey,nFlag,oB|(Chr(nKey)$"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ")}
Thank you Silvio,
This is what I will do, but directly in TGET class.
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Post Reply