Caret Feature Code Examples

This section contains examples of code written in BASIC (Using the caret feature) showing how many of the LabelWriter commands are used.

HT Horizontal Tab Example

OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1
PRINT #1, “^027*Total^0091.99^010^012”;

LF Line Feed Example

 

OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1
PRINT #1, “^027*Line 1^010^010^010Line 4^010^012”;

FF Form Feed Example

 

OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1
PRINT #1, “^027*^029L^001^150Feed Length"
PRINT #1, “ = 2 inches^010^012”;

CR Carriage Return Example

 

OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1
PRINT #1, “^027*Line of Text^013^012”;

SO Set Font to Double Wide Example

 

OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1
PRINT #1, “^027*Normal ^014Wide^020Normal^010^012”;

DC4 Cancel Double Wide Mode Example

 

OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1
PRINT #1, “^027*Normal ^014Wide^020Normal^010^012”;

SYN EL Mode Graphics Example

 

OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1
PRINT #1, “027*^027B^010^027D^012”;
FOR I = 1 TO 100
PRINT #1, “^022”;
FOR J = 1 to 12
PRINT #1, “^085”;
NEXT J
NEXT I
PRINT #1, “^012”;

ETB EL Mode Compressed Graphics Example

 

OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1
PRINT #1, “^027*^027B^010^027D^012”;
FOR I = 1 TO 100
PRINT #1, “^023^095”;
NEXT I
PRINT #1, “^012”;

20h - FFh Printable Characters Example

 

OPEN "COM1:9600,n,8,1" FOR OUTPUT AS #1
PRINT #1, “^027*";
FOR I = 32 TO 127
PRINT #1, CHR$(I); " ";
NEXT I
PRINT #1, "^010";
PRINT #1, "Print a trademark ^153”
PRINT #1, "Print a copyright ^169”
PRINT #1, "Print a Register ^174”
PRINT #1, "Print a Degree ^176”
PRINT #1, “^012”;

ESC * Reset to Defaults Example

 

OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1
PRINT #1, “^027*The printer is reset twice^010^012^027@"

ESC @ Reset to Power-up Condition Example

 

OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1
PRINT #1, “^027*The printer is reset twice^010^012^027@"

ESC B Set Dot Tab Example

 

OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1
PRINT #1, “^027*^027B^010^027D^012”;
FOR I = 1 TO 100
PRINT #1, “^023^095”;
NEXT I
PRINT #1, “^012”;

ESC D Set Bytes per Line Example

 

OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1
PRINT #1, “^027*^027B^010^027D^012”;
FOR I = 1 TO 100
PRINT #1, “^023^095”;
NEXT I
PRINT #1, “^012”;

ESC E Form Feed Example

 

OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1
PRINT #1, “^027*ESC E Ejects a Label^010^027E";

ESC J Feed n Sublines Example

 

OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1
PRINT #1, “^027*First Line^010^027J^203One inch";
PRINT #1, “ below First Line^012”;

ESC M Set Font to 12 cpi Example

 

OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1
PRINT #1, “^027*^027M12 cpi ^010^012”;

ESC P Set Font to 16 cpi Example

 

OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1
PRINT #1, “^027*^027P16 cpi^010^012”;

ESC S Set Font to 20 cpi Example

 

OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1
PRINT #1, “^027*^027S20 cpi^010^012”;

ESC T Set Font to 7 cpi Example

 

OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1
PRINT #1, “^027*^027T7 cpi^010^012”;

ESC U Set Font to 10 cpi Example

 

OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1
PRINT #1, “^027*^027U10 cpi^010^012”;

ESC X Set Horizontal Starting Position Example

 

OPEN "COM1:9600,n,8,1" FOR OUTPUT AS #1
PRINT #1, “^027*^029t^030^029V1";
PRINT #1, “True Left Margin^010";
PRINT #1, “^027X^001^150";
PRINT #1, “2 inch ";
PRINT #1, “Indent^010";
PRINT #1, “^027X^000^203";
PRINT #1, “1 inch Indent";
PRINT #1, “^010^012”;

ESC Y Set Vertical Starting Position Example

 

OPEN "COM1:9600,n,8,1" FOR OUTPUT AS #1
PRINT #1, “^027*^029t^030^029V1";
PRINT #1, “True Top Margin^010";
PRINT #1, “^027Y^020";
PRINT #1, “20 millimeters from the top^010";
PRINT #1, “^027Y^010";
PRINT #1, “10 millimeters from the top^010";
PRINT #1, “^012”;

GS DC2 Set Font to Double Height Example

 

OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1
PRINT #1, “^027*^027T^029^018";
PRINT #1, “This line is Double Height^010";
PRINT #1, “^029^019";
PRINT #1, “This line is Normal Height^010";
PRINT #1, “^012”;

GS DC3 Cancel Double Height Example

 

OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1
PRINT #1, “^027*^027T^029^018";
PRINT #1, “This line is Double Height^010";
PRINT #1, “^029^019";
PRINT #1, “This line is Normal Height^010";

PRINT #1, “^012”;

GS RS Set Inverse Print Mode Example

 

OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1
PRINT #1, “^027*Normal ";
PRINT #1, “^029^030Inverse^029^031 ";
PRINT #1, “Normal^010";
PRINT #1, “^012”;

GS US Cancel Inverse Print Mode Example

 

OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1
PRINT #1, “^027*Normal ";
PRINT #1, “^029^030Inverse^029^031 ";
PRINT #1, “Normal^010";
PRINT #1, “^012”;

GS * Landscape Mode Graphics Example

 

OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1
PRINT #1, “^027*^029t^040^029V1";
PRINT #1, “^029*^001^001^003^010^010”;
FOR I = 1 to 100
PRINT #1, CHR$(I);
NEXT I
PRINT #1, "^012";

GS A Starting Position of Bar Code Example

 

OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1
PRINT #1, “^027*";
PRINT #1, “^029A^000^203";
PRINT #1, “^029h^203^029W^003^005";
PRINT #1, “^029k^004^006DYMO";
PRINT #1, “^012”;

GS L Set Feed Length Example

 

OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1
PRINT #1, “^027*";
PRINT #1, “^029t^036^029V^001";
PRINT #1, “This is Line One^010";
PRINT #1, “This is Line Two^010";
PRINT #1, “^012”;

GS T Select Line Wrap/Truncate Modes Example

 

OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1
PRINT #1, “^027*";
PRINT #1, “^029T^003^029u^014";
PRINT #1, “This is Line 1 This is Line 2^010";
PRINT #1, “^012”;

GS V Set Print Orientation Example

 

OPEN "COM1:9600,n,8,1" FOR OUTPUT AS #1
PRINT #1, “^027";
PRINT #1, “*^029t^011^029V^001";
PRINT #1, “This is in^010";
PRINT #1, “203 x 203^010Landscape^010Mode^010";
PRINT #1, “^029V^000This is in^010Portrait Mode^010";
PRINT #1, “^029t^011^029V^002";
PRINT #1, “This is in^010138 x 203";
PRINT #1, “^010Landscape^010Mode^010";
PRINT #1, “^012”;

GS W Set Bar Code Element Width Example

 

OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1
PRINT #1, “^029A^000^203";
PRINT #1, “^029h^203^029W^003^005";
PRINT #1, “^029k^004^006DYMODYMO^010";
PRINT #1, “^012”;

GS d Feed n Text Lines Example

 

OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1
PRINT #1, “^027*This is Line 1^010";
PRINT #1, “^029d^004This is Line 6^010";
PRINT #1, “^012”;

GS h Set Bar Code Height Example

 

OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1
PRINT #1, “^029A^000^203";
PRINT #1, “^029h^203";
PRINT #1, “^029W^003^005";
PRINT #1, “^029k^004^006DYMODYMO^010";
PRINT #1, “^012”;

GS k Print Bar Code Example

 

OPEN "COM1:9600,n,8,1" FOR OUTPUT AS #1
PRINT #1, “^027*^029t^030^029V1";
PRINT #1, “^029h^101^";
PRINT #1, “029k^011^000*01234567890*01234567890";
PRINT #1, “^012”;

GS l Draw Line in Landscape Mode Example

The above example prints a line that is 3-dots wide, 1-inch long, and located 1 inch from the left.

OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1
PRINT #1, “^027*^029t^030^029V^001";
PRINT #1, “^029^108^000^203^000^203^007";
PRINT #1, “^012";

GS q Print UPC/EAN Checksum Example

 

OPEN "COM1:9600,n,8,1" FOR OUTPUT AS #1
PRINT #1, “^027*^029t^037^029V^004";
PRINT #1, “^029h^101^029k^002^011";
PRINT #1, “01234567890";
PRINT #1, “01234567890^029q^002^011";
PRINT #1, “01234567890";
PRINT #1, “^012";

GS t Set Characters per Line in Landscape Example

 

OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1
PRINT #1, “^027*^029t^017^029V1";
PRINT #1, "This is Line One This is Line Two^010^012";

GS u Set Characters per Line in Portrait Example

 

OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1
PRINT #1, “^029T^003”;
PRINT #1, “^029u^017This is Line One This is Line 2";

GS w Set Bar Code Module Width Example

 

OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1
PRINT #1, “^029A^000^203”;
PRINT #1, “^029h^203”;
PRINT #1, “^029w^003^005”;
PRINT #1, “^029k^004^006”;
PRINT #1, "DYMO";
PRINT #1, "DYMO^010^012”;