restrict barcode

Other discussions about CSPro
Forum rules
New release: CSPro 8.0
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: restrict barcode

Post by Gregory Martin »

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

Post by Show87 »

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: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: restrict barcode

Post by Gregory Martin »

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

Post by Show87 »

Thank you very much Greg
Show87
Posts: 7
Joined: March 1st, 2017, 6:33 am

Re: restrict barcode

Post by Show87 »

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