PICTURE for only Numbers and Chars

PICTURE for only Numbers and Chars

Postby vilian » Mon Jul 08, 2019 7:26 pm

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: 920
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: PICTURE for only Numbers and Chars

Postby vilian » Mon Jul 08, 2019 7:53 pm

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

Re: PICTURE for only Numbers and Chars

Postby karinha » Mon Jul 08, 2019 7:57 pm

Veja se ajuda:

Code: Select all  Expand view

   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 - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7214
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: PICTURE for only Numbers and Chars

Postby vilian » Mon Jul 08, 2019 8:02 pm

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

Re: PICTURE for only Numbers and Chars

Postby Silvio.Falconi » Tue Jul 09, 2019 11:36 am

perhpas it need a a valid function....
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6772
Joined: Thu Oct 18, 2012 7:17 pm

Re: PICTURE for only Numbers and Chars

Postby vilian » Tue Jul 09, 2019 11:55 am

Or just that PICTURE "@N" Works !
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 920
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: PICTURE for only Numbers and Chars

Postby James Bott » Tue Jul 09, 2019 3:24 pm

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

https://www.itlnet.net/programming/program/Reference/c53g01c/ngaee8c.html
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: PICTURE for only Numbers and Chars

Postby Euclides » Tue Jul 09, 2019 4:47 pm

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
Euclides
 
Posts: 154
Joined: Wed Mar 28, 2007 1:19 pm

Re: PICTURE for only Numbers and Chars

Postby vilian » Tue Jul 09, 2019 4:55 pm

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

Re: PICTURE for only Numbers and Chars

Postby James Bott » Tue Jul 09, 2019 7:06 pm

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
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: PICTURE for only Numbers and Chars

Postby vilian » Tue Jul 09, 2019 7:45 pm

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

Re: PICTURE for only Numbers and Chars

Postby James Bott » Wed Jul 10, 2019 12:17 am

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
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: PICTURE for only Numbers and Chars

Postby Silvio.Falconi » Wed Jul 10, 2019 7:54 am

oGet:bChange := { | nKey,nFlag,oB|(Chr(nKey)$"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ")}
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6772
Joined: Thu Oct 18, 2012 7:17 pm

Re: PICTURE for only Numbers and Chars

Postby vilian » Wed Jul 10, 2019 10:49 am

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: 920
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: PICTURE for only Numbers and Chars

Postby vilian » Wed Jul 10, 2019 10:50 am

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

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 92 guests