Goal : To accept 13 digit numeric value from input
Challenge: A13 accepts alphabets whereas the requirement is to restrict alphabets.
Plan: To create a validation to restrict the alphabets to be entered in the input.
Code:
event inq : 2
var barcode : A13
input barcode, "Enter a number and press [ENTER]"
if len(barcode) <> 13
errormessage "Error in Barcode"
exitcontinue
endif
//if the input of barcode contains alphabets exit
infomessage barcode
endevent
Challenge: A13 accepts alphabets whereas the requirement is to restrict alphabets.
Plan: To create a validation to restrict the alphabets to be entered in the input.
Code:
event inq : 2
var barcode : A13
input barcode, "Enter a number and press [ENTER]"
if len(barcode) <> 13
errormessage "Error in Barcode"
exitcontinue
endif
//if the input of barcode contains alphabets exit
infomessage barcode
endevent