beautypg.com

Element printing example – Seiko BX-900 User Manual

Page 89

background image

Element printing example

[Example]
The following shows a BASIC program for printing Code 39 bar codes using the element printing
function. This example shows how to print “CODE39”. (Replace NB, WB, NS and WS in the data
statements in the following example with 0, 1, 2 and 3, respectively.)

100 OPEN "LPT1:" AS #1: WIDTH #1,255
110 DC4$=CHR$ (&H14): ESC$=CHR$(&H1B)
120 SI$=CHR$(&HF):SO$=CHR$(&HE): ICG=4
130 '
140 PRINT #1, DC4$;DC4$;"@"; ' Initialize
150 PRINT #1, DC4$;DC4$;"T";CHR$(255); ' Barcode Type: Element Print
160 PRINT #1, DC4$;DC4$;"E";CHR$(0);CHR$(2); ' Narrow Bar: 2/120"
170 PRINT #1, DC4$;DC4$;"E";CHR$(1);CHR$(6); ' Wide Bar: 6/120"
180 PRINT #1, DC4$;DC4$;"E";CHR$(2);CHR$(2); ' Narrow Space: 2/120"
190 PRINT #1, DC4$;DC4$;"E";CHR$(3);CHR$(6); ' Wide Space: 6/120"
200 PRINT #1, DC4$;DC4$;"E";CHR$(4);CHR$(2); ' Inter Char Gap: 2/120"
210 PRINT #1, DC4$;DC4$;"H";CHR$(6); ' Barcode Height: 6/12"
220 '
230 PRINT #1, DC4$;DC4$;"B";CHR$(9*8+7); ' Barcode Data Sequence Start
240 RESTORE 440
250 FOR I=1 TO 9:READ A:PRINT CHR$(A);:NEXT I
260 PRINT #1, CHR$(ICG);
270 FOR J=1 TO 6
280 IF J=1 THEN RESTORE 450
290 IF J=2 THEN RESTORE 460
300 IF J=3 THEN RESTORE 470
310 IF J=4 THEN RESTORE 480
320 IF J=5 THEN RESTORE 490
330 IF J=6 THEN RESTORE 500
340 FOR I=1 TO 9:READ A: PRINT #1, CHR$(A);:NEXT I
350 PRINT #1, CHR$(ICG);
360 NEXT J
370 RESTORE 440
380 FOR I=1 TO 9:READ A: PRINT #1, CHR$(A);:NEXT I
400 PRINT #1,CHR$(13);CHR$(10); ' CR+LF
410 CLOSE #1
420 END
430 '
440 DATA 0, 3, 0, 2, 1, 2, 1, 2, 0
450 DATA 1, 2, 1, 2, 0, 3, 0, 2, 0
460 DATA 1, 2, 0, 2, 1, 2, 0, 3, 0
470 DATA 0, 2, 0, 2, 1, 3, 0, 2, 1
480 DATA 1, 2, 0, 2, 1, 3, 0, 2, 0
490 DATA 1, 2, 1, 3, 0, 2, 0, 2, 0
500 DATA 0, 2, 1, 3, 0, 2, 1 ,2, 0

81

9. Bar code and enlarged character