Sunday, September 27, 2015

Smart Label Pro - something recognizable



OPEN "COM1:9600,N,8,1,CD0,CS0,DS0,OP0,RB65535" FOR RANDOM AS #1
SCREEN 12
LINE (0, 0)-(639, 199), , B


LOCATE 2, 2: PRINT "Smart Label Printer PRO"
LOCATE 4, 2: PRINT "0x04 print data"
LOCATE 6, 2: PRINT "0x09 tab"
LOCATE 8, 2: PRINT "0x0c formfeed"

FOR xpos = 0 TO 639 STEP 1

PRINT #1, CHR$(9); CHR$(90); ' need to tab to position 90
PRINT #1, CHR$(4); CHR$(200 / 8);
FOR ypos = 199 TO 0 STEP -8

nextbyte = 0
pixelnum = 7
FOR ypos2 = ypos TO ypos - 7 STEP -1
IF POINT(xpos, ypos2) <> 0 THEN nextbyte = nextbyte + 2 ^ pixelnum
pixelnum = pixelnum - 1
NEXT ypos2

PRINT #1, CHR$(nextbyte);

NEXT ypos
NEXT xpos
PRINT #1, CHR$(12); 'form feed

CLOSE #1

No comments:

Post a Comment