DEFINE CLASS zebralabel AS rbproductlabel NAME = "zebralabel" PROCEDURE itemprice_assign LPARAMETERS vNewVal *!* 04/05/03 13:35:26 nf 2: Changed from IF to CASE. *!* Sometimes the price is being cut off in the Received PO form DO CASE CASE VARTYPE(vNewVal)="Y" THIS.ItemPrice = ALLTRIM(TRANSFORM(MTON(vNewVal),"@$")) CASE VARTYPE(vNewVal)="N" THIS.ItemPrice = ALLTRIM(TRANSFORM(vNewVal,"@$")) CASE VARTYPE(vNewVal) = "C" THIS.ItemPrice = ALLTRIM(vNewVal) OTHERWISE THIS.ItemPrice = "" ENDCASE ENDPROC PROCEDURE PRINT LPARAMETERS cText LOCAL lcSavePrinter, lcPrinter, lcOriginal, lcLabel, lcSetPrinter lcSetPrinter = SET("PRINTER") SET PRINTER OFF lcOrignal = SET("Printer",2) lcLabel = THIS.BuildLabel() IF VERSION(2) = 2 lcSavePrinter = "LabelPrinter.MEM" ELSE lcSavePrinter= ADDBS(JUSTPATH(SYS(16,0)))+ ; "LabelPrinter.MEM" ENDIF IF FILE(lcSavePrinter) lcPrinter = FILETOSTR(lcSavePrinter) ELSE MESSAGEBOX("The next screen will let you " + ; "select a label printer...",32, ; _SCREEN.CAPTION, 10000 ) lcPrinter = GETPRINTER() IF EMPTY( lcPrinter ) MESSAGEBOX("Unable to print labels " + ; " with a label printer.", 16, ; _SCREEN.CAPTION ) RETURN .F. ENDIF ENDIF SET SAFETY OFF STRTOFILE(lcPrinter,lcSavePrinter,0) SET PRINTER TO NAME "&lcPrinter" ???lcLabel && Write the string out to the device SET PRINTER TO NAME "&lcOrignal" && Restore the printer ENDPROC PROCEDURE BuildLabel LOCAL lcLabel, lcItemName *!* 04/05/03 13:17:37 nf 2: Shortened up the name *!* lcItemName = SUBSTR(THIS.ItemName,1,INT(20.3*1.6875)) lcItemName = STRTRAN(lcItemName,'\','\\') lcItemName = STRTRAN(lcItemName,'"','\"') *!* Documentation follows in compiler IF below. *!* Do not change any of the lines within the *!* TextMerge block TEXT TO lcLabel TEXTMERGE NOSHOW R000,000 O q350 Q101,25+0 S3 N B15,22,0,UA0,1,2,62,B,<<'"'+TRIM(this.ItemUPC)+'"'>> A11,0,0,1,1,1,N,<<'"'+lcItemName+'"'>> A150,20,0,1,1,1,N,<<'"'+this.ItemProductID+'"'>> A155,37,0,2,1,1,N,"Rooster Brother" A210,62,0,2,1,1,N,<<'"'+LTRIM(this.ItemPrice)+'"'>> P<<TRANSFORM(this.Copies)>>,1 ENDTEXT RETURN lcLabel *!* Document the TextMerge. See EPL2_Manual.pdf for *!* all commands #IF .F. <<TRIM(TRANSFORM(THIS.COPIES))>> R000,000 && Set registration O && Machine options q350 && Width Q101,25+0 && Height, Gap D15 && Density S3 && Speed N && Clear buffer A15,3,0,1,1,1,N,"Licorice" && ASCII A200,26,0,1,1,1,N,"11402" && Item # A200,45,0,1,1,1,N,"My Retail Store" A210,73,0,1,1,1,N,"$" A230,71,0,1,1,1,N,"4.55" B10,26,0,UA0,2,2,49,N,"726562208042" && The UPC P1,1 && Print n Sets, n Labels each set && Necessary blank line #ENDIF ENDPROC ENDDEFINE * *-- EndDefine: zebralabel **************************************************