
Chapter 8. Files
137
8.3.2 Programming for Bar Code Device
■
Code Mark
The
MARK$
function allows you to check the code mark (denoting the code type) and the
length of the inputted bar code data.
This function returns a total of three bytes: one byte for the code mark and two bytes for the
data length.
BHT-100Q If the data length of a read 2D code exceeds 99 digits, the two bytes of the
returned value for the data length will indicate 00. To check the length of such 2D code
data, therefore, use the
LOC
function.
■
Multiple Code Reading
You may activate the multiple code reading feature which reads more than one code type
while automatically identifying them. To do it, you should designate desired code types fol-
lowing the CODE in the
OPEN
"BAR:"
statement.
The BHT-100Q can identify more than one bar code type and/or more than one 2D code
type; the BHT-100B can do more than one bar code type.
■
Note for Reading Data in a 2D Code (for the BHT-100Q)
A single 2D code can contain more than hundreds of digits of data. From a 2D code con-
taining 255 digits or more, a single
INPUT#
or
LINE
INPUT#
statement cannot read out
all of the data. For such a 2D code, you need to check the data length with the
LOC
func-
tion and then call the
INPUT$
function by the number of times required.
Given below is a typical programming sample for reading a 2D code containing more than
255 digits of data.
dim BUF$(20)[255]
’Define the data buffer for 5100
’bytes.
f.no%=2
’Designate the bar code device file.
open"BAR:B"as #f.no% code "Q","A"
’Enable reading of QR codes and
’universal product codes.
wait 0,&h02
’Wait for completion of code reading.
for n%=1 to 100
len%=loc (#f.no%)
’Check the number of digits.
if len%>0 then
’Inspect the number of digits.
if len%>255 then
len%=255
endif
BUF$ (n%)=input$(len%,f.no%)
’Read out data.
else
’Has read out all data.
n%=20
endif
next n%
READEND:
close #f.no%
Содержание BHT-BASIC 100 SERIES
Страница 1: ......
Страница 161: ...153 Chapter 10 Sleep Function CONTENTS 10 1 Sleep Function 154...
Страница 163: ...155 Chapter 11 Resume Function CONTENTS 11 1 Resume Function 156...
Страница 173: ...165 Chapter 13 Backlight Function CONTENTS 13 1 Backlight Function 166...
Страница 192: ...Chapter 14 Statement Reference 184 Example OPEN master Dat AS 1 FIELD 1 20 AS bar 10 AS ky CLFILE 1 CLOSE 1...
Страница 249: ...241 Example CLOSE IF kyIn Y THEN KILL Master Dat END IF Reference Statements CLFILE...
Страница 349: ...341 Run time errors Error code Meaning 05h Parameter out of the range checktype is out of the range...
Страница 383: ...375 Run time errors Reference Error code Meaning 05h Parameter out of the range Functions LEFT LEN and RIGHT...