ZBi : input the quantity of label with a barcode reader

how to enter a number of labels to print from a barcode reader
the goal being to scan a product code then enter an X quantity with the scanner to print X labels

or how can we scan a code with the scanner for go out of the loop in the following example ?

Input #In : REF$
let ref = find(GIF$,1,REF$,1)
sub RGIF
Print #Out : "^XA^XFE:GIF.ZPL^FS^FN1^FD" & GIF$(ref,2) & "^FS^XZ"
On Error Goto NotFind
goto RGIF