How about:
Data$ = ""
Data$ += "^XA^LRN^CI0^XZ" ! start format, reverse image, FontEncoding, stop format
Data$ += "^XA" ! Start format
Data$ += "^MMT^JZY" ! Tearoff, reprint on error
Data$ += "^LT0^PON^PMN^LH0,0^JMA" !
Data$ += "^PW812" ! Label Width in dots (from 203 dot GK420T)
Data$ += "^LL1218" ! Label Length in dots (from 203 dot GK420T)
Data$ += "^LS0" ! Label shift to 0
Data$ += "^FO34,750^GB738,417,8^FS" ! Draw Box
Data$ += "^FT619,985^A0I,169,196^FH\^FDSTOP^FS" ! ! STOP
Data$ += "^FT724,820^A0I,118,122^FH\^FDDo Not Apply^FS" ! DO NOT APPY
Data$ += "^FT507,665^A0I,66,70^FH\^FD" + This'FormatContainerID$(ContainerID$, 0) + "^FS" ! Human Readable Bar Code Value - ContainerID last 6 digits
if CompanyCode$ > "" \
then Data$ += "^FT770,560^A0I,51,52^FH\^FD" + "Inv: " + CompanyCode$ + " " + InvoiceNo$ + " " + This'DisplayDate$(InvoiceDate$) + "^FS" ! Text Comp InvoiceNo InvoiceDate
if CustomerCode$ > "" then \
{
tmp$ = stp(stp(CustomerAbbrev$, 2) + " " + CustomerCode$ + "-" + ShipToCode$ + " " + ShipToProvAbbrev$, 2)
Data$ += "^FT770,495^A0I,51,52^FH\^FD" + "Cst: " + tmp$ + "^FS" ! Text CustAbbv, Cust#, ShipTo#, Prov
}
Data$ += "^FT770,395^A0I,51,52^FH\^FDError:^FS" ! Text Error
Data$ += "^FT630,395^A0I,51,52^FH\^FD" + str(ErrorCode) + "^FS" ! Text ErrorCode
! Error Text, we need to watch out for how LONG the text is
! Seems to be 40 chars per line, max 5 lines
tmp$ = stp(ErrorText$, 2), line = 0
dim line$[ 1 : 5 ]
while tmp$ > ""
if line >= 5 \
then break
if len(tmp$) <= 33 then \
{
Line$[ ++line ] = tmp$, \
tmp$ = ""
} else \
{
x = pos(" ,." : tmp$(1, 34), -1)
if x >= 18 then \
{
Line$[ ++line ] = stp(mid(tmp$, 1, x - 1))
tmp$ = stp(mid(tmp$, x + 1), 2)
} else \
{
Line$[ ++line ] = stp(mid(tmp$, 1, 33))
tmp$ = stp(mid(tmp$, 34), 2)
}
}
wend
LineY = 330
if Line$[1] > "" \
then Data$ += "^FT770," + str(LineY) + "^A0I,51,52^FH\^FD" + Line$[1] + "^FS"; LineY -= 65 ! Text ErrorText Line 1
if Line$[2] > "" \
then Data$ += "^FT770," + str(LineY) + "^A0I,51,52^FH\^FD" + Line$[2] + "^FS"; LineY -= 65 ! Text ErrorText Line 1
if Line$[3] > "" \
then Data$ += "^FT770," + str(LineY) + "^A0I,51,52^FH\^FD" + Line$[3] + "^FS"; LineY -= 65 ! Text ErrorText Line 1
Data$ += "^PQ1,0,1,Y^XZ" ! Print Quality 1, pause&cut, replicates, Override pause count