compile function PRINT_TUBE_LABELS( NumPages )
begin condition 
pre:
post:
end condition

$insert logical
$insert msg_equates
equ CrLf$ to char(13):char(10)

declare function fieldcount, msg, get_printer, set_printer, entid, Printer_Select

Grade        = 'Grade______'
SerialNumber = 'S/N_________________'
Description  = '_________________________'
TopPlate     = '    Top Plate______________'
LowBottomPlate = 'Lower Bottom Plate_______'
Flanges        = 'Flanges //_____'
BothFlanges       = 'Lg Fl_____':fmt( '', 'L#5' ):'Sm Fl_____'
if not( assigned( NumPages ) ) then
   NumPages = 1
end
MaxLabels         = 10
Text = 'Please place ':NumPages:' sheet(s) of Process Chamber Labels (Label Side Down ) in the top of the tray.':CrLf$:CrLf$:'then click OK'
MsgInfo = ''
MsgInfo<mtext$> = Text
MsgInfo<micon$> = '!'
Void = msg( '', MsgInfo )
PrintPath = Printer_Select('')	;* Get printer path
Void = set_printer( 'INIT', '', '', .25:@fm:.5:@fm:.25:@fm:.5, 0,PrintPath )
Font = "Courier New,13,L,1"
convert ',' to @fm in Font
Void = set_printer( 'FONT', Font )
for i = 1 to NumPages
   for j = 1 to 5  ;* THERE ARE FIVE ROWS OF LABELS ON THIS PARTICULAR LABEL
		LineOut = fmt( Grade, 'R#35' ):fmt( '', 'L#3' ):fmt( Grade, 'R#35' )
		Void = set_printer( 'TEXT', LineOut )
		LineOut = fmt( SerialNumber, 'C#35' ):fmt( '', 'L#3' ):fmt( SerialNumber, 'C#35' )
		Void = set_printer( 'TEXT', LineOut )
		LineOut = fmt( Description, 'C#35' ):fmt( '', 'L#3' ):fmt( Description, 'C#35' )
		Void = set_printer( 'TEXT', LineOut )		
		Void = set_printer( 'TEXT', '' )
		LineOut = fmt( TopPlate, 'C#35' ):fmt( '', 'L#3' ):fmt( TopPlate, 'C#35' )		
		Void = set_printer( 'TEXT', LineOut )
		LineOut = fmt( LowBottomPlate, 'C#35' ):fmt( '', 'L#3' ):fmt( LowBottomPlate, 'C#35' )		
		Void = set_printer( 'TEXT', LineOut )
		Void = set_printer( 'TEXT', '' )
		LineOut = fmt( Flanges, 'C#35' ):fmt( '', 'L#3' ):fmt( Flanges, 'C#35' )		
		Void = set_printer( 'TEXT', LineOut )
		LineOut = fmt( BothFlanges, 'C#35' ):fmt( '', 'L#3' ):fmt( BothFlanges, 'C#35' )		
		Void = set_printer( 'TEXT', LineOut )
		Void = set_printer( 'TEXT', '' )
	next j
	if i = NumPages else
	   Void = set_printer( 'PAGEBREAK' )
	end
next i
Void = set_printer( 'TERM' )
return 0

