restrict barcode

Other discussions about CSPro
Gregory Martin
Posts: 852
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: restrict barcode

Postby Gregory Martin » February 21st, 2017, 4:53 pm

Ah, you're right. I didn't read the post as thoroughly as I should have. My code will not allow 0xxxx values through.

Show87
Posts: 7
Joined: March 1st, 2017, 6:33 am

Re: restrict barcode

Postby Show87 » April 20th, 2017, 7:38 am

HELLO

I want to restrict barcode number to only allow Alphanuremic that starts with "N123456"

so that captures cant enter any numbe

I tried this code

if QI2A[1] <> "N" then
errmsg("Le numero BVM doit commencé par N");
reenter;
endif;


But it does not work.
The error message appears even when entering the "N"

Gregory Martin
Posts: 852
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: restrict barcode

Postby Gregory Martin » April 20th, 2017, 7:53 am

string_variable[1] will return the whole string, starting at position 1. You want to check just the first character, which you can do like this:

if QI2A[1:1] <> "N" then

Show87
Posts: 7
Joined: March 1st, 2017, 6:33 am

Re: restrict barcode

Postby Show87 » April 20th, 2017, 8:08 am

Thank you very much Greg

Show87
Posts: 7
Joined: March 1st, 2017, 6:33 am

Re: restrict barcode

Postby Show87 » April 20th, 2017, 8:11 am

Thank you very much Greg...... :D :D :D :D


Return to “Other”