compile function PRINT_CLEANROOM_LABELS_SMALL( RdsIds )
begin condition 
pre:
post:
end condition

$insert logical
$insert msg_equates
$insert rds_equ
$insert rds_layer_info_equ
$insert oiprint_equates
$insert prod_spec_equ
$insert quote_spec_equ

declare function fieldcount, msg, key_sort, get_printer, set_printer, entid
declare function repository, print_wo_labels,Printer_Select
declare subroutine extract_si_keys

CLOrientation = '' ;* used for printing on cleanroom labels
if RdsIds then
    IdCnt = fieldcount( RdsIds, @fm )
    * sort by run order number
    if IdCnt > 1 then
        RdsIds = key_sort( RdsIds, 'RDS', 'WO':@fm:'RUN_ORDER_NUM', 1, '', '' )
    end
    gosub PrintCleanRoomLabels
    
    UniqueWOs = ''
    AllWOs = xlate( 'RDS', RdsIds, rds_wo$, 'X' )
    for i = 1 to IdCnt
       ThisWO = AllWOs<i>
       locate ThisWO in UniqueWOs using @vm setting Fpos else
          UniqueWOs<1,-1> = ThisWO
       end 
    next i
    gosub PrintWOLabels        
end
return 0
*===========================================================================*
PrintCleanRoomLabels:
   CustAbbrev  = xlate( 'RDS', RdsIds, 'ABBREV_OR_CO_NAME', 'X' )
   WO          = xlate( 'RDS', RdsIds, rds_wo$, 'X' )
   ThickTarget = oconv( xlate( 'RDS', RdsIds, rds_thick_target$, 'X' ), 'MD2' )
   ThickUnit   = xlate( 'RDS', RdsIds, rds_thick_units$, 'X' )
   ResTarget   = oconv( xlate( 'RDS', RdsIds, rds_res_target$, 'X' ), 'MD2' )
   ResUnit     = xlate( 'RDS', RdsIds, rds_res_units$, 'X' )
   LotNum      = xlate( 'RDS', RdsIds, rds_lot_num$, 'X' )
   RecipeIDS   = xlate( 'RDS', RdsIds, rds_recipe_no$, 'X' )
   RecipeInfo  = xlate( 'RECIPE', RecipeIDS, 'RECIPE_NAME_NO', 'X' )
   RONum       = xlate( 'RDS', RdsIds, 'RUN_ORDER_NUM', 'X' )
   PSNIds      = xlate( 'RDS', RdsIds, rds_prod_spec_id$, 'X' )   
   ThickVar    = xlate( 'PROD_SPEC', PSNIds, 'THICK_MEASURE_L1', 'X' )
   ResVar      = xlate( 'PROD_SPEC', PSNIds, 'RES_MEASURE_L1', 'X' )
   ConVar      = xlate( 'PROD_SPEC', PSNIds, 'CON_MEASURE_L1', 'X' )
   StressVar   = xlate( 'PROD_SPEC', PSNIds, 'STRESS_MEASURE', 'X' )
   TransVar    = xlate( 'PROD_SPEC', PSNIds, 'TRANS_MEASURE', 'X' )
   SpecType    = oconv( xlate( 'RDS', RdsIds, 'SPEC_TYPE', 'X' ), '[SPEC_TYPE_CONV]' )
   convert @lower_case to @upper_case in SpecType
   SRPFlag     = xlate( 'PROD_SPEC', PSNIds, 'SRP_REQ', 'X' )
   Qtys        = xlate( 'RDS', RdsIds, 'WAFERS_SCHEDULED', 'X' )
   MultilayVar = xlate( 'RDS', RdsIds, 'MULTI_LAYER', 'X' )
   * LETS BREAK OUT THICK AND RES AND SEE IF IT GETS MEASURED BASED ON FREQUENCY
   * THICKNESS
   ThickPrintVar = ''
   ResPrintVar   = ''
   SRPPrintVar   = ''
   SRPTypePrintVar = ''   
   for i = 1 to IdCnt
      ThisThickVar  = ThickVar<i>
      ThisResVar    = ResVar<i>
      ThisConVar    = ConVar<i>
      ThisStressVar = StressVar<i>
      ThisTransVar  = TransVar<i>
      ThisRunOrdNum = RONum<i>
      ThisWO        = WO<i>
      *
      ThickTool   = field( ThisThickVar, '~', 1 )
      ThickType   = field( ThisThickVar, '~', 2 )
      ThickRecipe = field( ThisThickVar, '~', 3 )
      ThickFreq   = field( ThisThickVar, '~', 4 )
      ThickFirst  = field( ThisThickVar, '~', 6 )
      ThickLast   = field( ThisThickVar, '~', 7 )
      *
      ResTool   = field( ThisResVar, '~', 1 )
      ResType   = field( ThisResVar, '~', 2 )
      ResRecipe = field( ThisResVar, '~', 3 )
      ResFreq   = field( ThisResVar, '~', 4 )
      ResFirst  = field( ThisResVar, '~', 6 )
      ResLast   = field( ThisResVar, '~', 7 )
      *
      ConTool   = field( ThisConVar, '~', 1 )
      ConType   = field( ThisConVar, '~', 2 )
      ConRecipe = field( ThisConVar, '~', 3 )
      ConFreq   = field( ThisConVar, '~', 4 )
      ConFirst  = field( ThisConVar, '~', 6 )
      ConLast   = field( ThisConVar, '~', 7 )
      *
      StressTool   = field( ThisStressVar, '~', 1 )
      StressType   = field( ThisStressVar, '~', 2 )
      StressRecipe = field( ThisStressVar, '~', 3 )
      StressFreq   = field( ThisStressVar, '~', 4 )
      StressFirst  = field( ThisStressVar, '~', 6 )
      StressLast   = field( ThisStressVar, '~', 7 )
      *
      TransTool   = field( ThisTransVar, '~', 1 )
      TransType   = field( ThisTransVar, '~', 2 )
      TransRecipe = field( ThisTransVar, '~', 3 )
      TransFreq   = field( ThisTransVar, '~', 4 )
      TransFirst  = field( ThisTransVar, '~', 6 )
      TransLast   = field( ThisTransVar, '~', 7 )
      *      
      extract_si_keys( 'RDS', 'WO', ThisWO, RDSsInWO )  
      WOBoxCnt = fieldcount( RDSsInWO, @vm )
      * FIRST CHECK THICKNESS
      PrintThickness = false$
      if ( ThisRunOrdNum = 1 ) and ( ThickFirst ) then
         PrintThickness = true$
      end
      if ( ThisRunOrdNum = WOBoxCnt ) and ( ThickLast ) then
         PrintThickness = true$
      end
      if ThickFreq then
         * NEED TO CHECK RUN ORDER AND SEE IF IT NEEDS TO BE PRINTED
         if ThickFreq = 1 then
            PrintThickness = true$
         end else
            * GENERATE FM DELIM OF RUNS THAT SHOULD PRINT
            RoPrintFlag = str( @fm, WOBoxCnt-1 )
            for j = 1 to WOBoxCnt step ThickFreq
               RoPrintFlag<j> = 1
            next j
            if ( RoPrintFlag<ThisRunOrdNum> = 1 ) then
               PrintThickness = true$            
            end
         end 
      end
      if PrintThickness then
         PSNRec    = xlate( 'PROD_SPEC', PSNIds<i>, '', 'X' )
         SpecSub   = PSNRec<prod_spec_spec_substrate$>
         *if ThickType <> 'Prod' then
            TOrient = SpecSub<1,QSSubOrientation$>
            convert '<' to '' in TOrient
            convert '>' to '' in TOrient
            Orient = TOrient
         *end else
         *   Orient = ''
         *end
         ThickPrintVar<i> = ThickTool:'~':ThickType:'~':Orient:'~':ThickRecipe
      end else
         ThickPrintVar<i> = ''
      end
      * NOW CHECK RESISTIVITY
      PrintResistivity = false$
      if ( ThisRunOrdNum = 1 ) and ( ResFirst ) then
         PrintResistivity = true$
      end
      if ( ThisRunOrdNum = WOBoxCnt ) and ( ResLast ) then
         PrintResistivity = true$
      end
      if ResFreq then
         * NEED TO CHECK RUN ORDER AND SEE IF IT NEEDS TO BE PRINTED
         if ResFreq = 1 then
            PrintResistivity = true$
         end else
            * GENERATE FM DELIM OF RUNS THAT SHOULD PRINT
            RoPrintFlag = str( @fm, WOBoxCnt-1 )
            for j = 1 to WOBoxCnt step ResFreq
               RoPrintFlag<j> = 1
            next j
            if ( RoPrintFlag<ThisRunOrdNum> = 1 ) then
               PrintResistivity = true$
            end                 
         end 
      end
      if PrintResistivity then
         PSNRec    = xlate( 'PROD_SPEC', PSNIds<i>, '', 'X' )
         SpecSub   = PSNRec<prod_spec_spec_substrate$>
         *if ResType <> 'Prod' then
            TOrient = SpecSub<1,QSSubOrientation$>
            convert '<' to '' in TOrient
            convert '>' to '' in TOrient
            Orient = TOrient
         *end else
         *   Orient = ''
         *end
         ResPrintVar<i> = ResTool:'~':ResType:'~':Orient:'~':ResRecipe
      end else
         ResPrintVar<i> = ''
      end
      PrintSRP = false$
      SRPType  = ''
      if SRPFlag<i> then
         * WE KNOW THAT SRP IS ONE OF THE TOOLS
	      if PrintThickness then
	         if ThickTool = 'SRP' then
	            PrintSRP = true$
	            SRPType  = ThickType
	         end
	      end
	      if PrintResistivity then
	         if ResTool = 'SRP' then
	            PrintSRP = true$
	            SRPType  = ResType
	         end
	      end
	      if PrintSRP then
	         * WE ARE ALREADY PRINTING IT SO NO NEED TO CHECK OTHER METROLOGY
	      end else
	        * NOW NEED TO CHECK CONCENTRATION
	        if ConTool = 'SRP' then
		        if ( ThisRunOrdNum = 1 ) and ( ConFirst ) then
		           PrintSRP = true$
		        end
		        if ( ThisRunOrdNum = WOBoxCnt ) and ( ConLast ) then
		           PrintSRP = true$
		        end
		        if ConFreq then
		           * NEED TO CHECK RUN ORDER AND SEE IF IT NEEDS TO BE PRINTED
		           if ConFreq = 1 then
		              PrintSRP = true$
		           end else
		              * GENERATE FM DELIM OF RUNS THAT SHOULD PRINT
		              RoPrintFlag = str( @fm, WOBoxCnt-1 )
		              for j = 1 to WOBoxCnt step ConFreq
		                 RoPrintFlag<j> = 1
 	   	           next j
 	   	           if ( RoPrintFlag<ThisRunOrdNum> = 1 ) then
		                 PrintSRP = true$
		              end                 
		           end 
		        end
		     end
		     if PrintSRP then
		        SRPType = ConType   
		     end
         end
         if PrintSRP then
	         * WE ARE ALREADY PRINTING IT SO NO NEED TO CHECK OTHER METROLOGY
	      end else
	        * NOW NEED TO CHECK STRESS
	        if StressTool = 'SRP' then
		        if ( ThisRunOrdNum = 1 ) and ( StressFirst ) then
		           PrintSRP = true$
		        end
		        if ( ThisRunOrdNum = WOBoxCnt ) and ( StressLast ) then
		           PrintSRP = true$
		        end
		        if StressFreq then
		           * NEED TO CHECK RUN ORDER AND SEE IF IT NEEDS TO BE PRINTED
		           if StressFreq = 1 then
		              PrintSRP = true$
		           end else
		              * GENERATE FM DELIM OF RUNS THAT SHOULD PRINT
		              RoPrintFlag = str( @fm, WOBoxCnt-1 )
		              for j = 1 to WOBoxCnt step StressFreq
		                 RoPrintFlag<j> = 1
 	   	           next j
 	   	           if ( RoPrintFlag<ThisRunOrdNum> = 1 ) then
		                 PrintSRP = true$
		              end                 
		           end 
		        end
		     end
		     if PrintSRP then
		        SRPType = StressType
		     end
	      end
         if PrintSRP then
	         * WE ARE ALREADY PRINTING IT SO NO NEED TO CHECK OTHER METROLOGY
	      end else
	        * NOW NEED TO CHECK TRANSITION
	        if TransTool = 'SRP' then
		        if ( ThisRunOrdNum = 1 ) and ( TransFirst ) then
		           PrintSRP = true$
		        end
		        if ( ThisRunOrdNum = WOBoxCnt ) and ( TransLast ) then
		           PrintSRP = true$
		        end
		        if TransFreq then
		           * NEED TO CHECK RUN ORDER AND SEE IF IT NEEDS TO BE PRINTED
		           if TransFreq = 1 then
		              PrintSRP = true$
		           end else
		              * GENERATE FM DELIM OF RUNS THAT SHOULD PRINT
		              RoPrintFlag = str( @fm, WOBoxCnt-1 )
		              for j = 1 to WOBoxCnt step TransFreq
		                 RoPrintFlag<j> = 1
 	   	           next j
 	   	           if ( ROPrintFlag<ThisRunOrdNum> = 1 ) then
		                 PrintSRP = true$
		              end                 
		           end 
		        end
		        if PrintSRP then
		           SRPType = TransType
		        end
		     end
	      end
	      if PrintSRP then
	         SRPPrintVar<i> = true$
	         SRPTypePrintVar<i> = SRPType
	      end else
	         SRPPrintVar<i> = false$
	         SRPTypePrintVar<i> = ''
	      end
      end else
         SRPPrintVar<i> = false$
         SRPTypePrintVar<i> = ''
      end
   next i
   * GOT ALL DATA NOW WE CAN PRINT     
   MaxLabels         = 14
   Pieces = int( IdCnt/MaxLabels )
   Rnd    = mod( IdCnt, MaxLabels ) 
   Pieces += ( Rnd > 0 )       
   Text = 'Please place ':Pieces:' sheet(s) of Cleanroom 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('',1)	;* Get default printer path
   Void = set_printer( 'INIT', '', '', 1.06:@fm:.53:@fm:.81:@fm:.38, 0,'',PrintPath )
   
   Font = "Courier New,10,L,0"
   convert ',' to @fm in Font
   Void = set_printer( 'FONT', Font )
	   LabelPrintCount = 0
	   LabelRowCnt     = 0
	   CustAbbrev      = CustAbbrev:@fm:CustAbbrev
	   WO              = WO:@fm:WO
      LotNum          = LotNum:@fm:LotNum
      RecipeInfo      = RecipeInfo:@fm:RecipeInfo
	   SpecType        = SpecType:@fm:SpecType               
      RONum           = RONum:@fm:RONum
	   RdsIds          = RdsIds:@fm:RdsIds
	   ThickPrintVar   = ThickPrintVar:@fm:ThickPrintVar
	   ResPrintVar     = ResPrintVar:@fm:ResPrintVar
	   MultiLayVar     = MultiLayVar:@fm:MultiLayVar
	   SRPPrintVar     = SRPPrintVar:@fm:SRPPrintVar
	   SRPTypePrintVar = SRpTypePrintVar:@fm:SRPTypePrintVar
	   Qtys            = Qtys:@fm:Qtys
	   ThickTarget     = ThickTarget:@fm:ThickTarget
	   ThickUnit       = ThickUnit:@fm:ThickUnit
	   ResTarget       = ResTarget:@fm:ResTarget
	   ResUnit         = ResUnit:@fm:ResUnit
	   
	   IdCnt += IdCnt ;* SO WE PRINT TWO SETS OF LABELS
	   for i = 1 to IdCnt step 2
         FirstThickTarget   = ThickTarget<i>
         FirstThickUnit     = ThickUnit<i>         
         FirstResTarget     = ResTarget<i>
         FirstResUnit       = ResUnit<i>                  
	      FirstCustAbbrev    = CustAbbrev<i>
		   FirstWO            = WO<i>
	      FirstLotNum        = LotNum<i>
	      FirstRecipeInfo    = RecipeInfo<i>
		   FirstSpecType      = SpecType<i>
	      FirstRONum         = RONum<i>
		   FirstRdsId         = RdsIds<i>
		   FirstThickPrintVar = ThickPrintVar<i>
		   FirstResPrintVar   = ResPrintVar<i>
		   FirstMultiLayVar   = MultiLayVar<i>
		   FirstSRPPrintVar   = SRPPrintVar<i>
		   FirstSRPTypePrintVar = SRPTypePrintVar<i>
		   FirstQty             = Qtys<i> 
         *
         SecondThickTarget     = ThickTarget<i+1>
         SecondThickUnit       = ThickUnit<i+1>
         SecondResTarget       = ResTarget<i+1>
         SecondResUnit         = ResUnit<i+1>
		   SecondCustAbbrev      = CustAbbrev<i+1>
		   SecondWO              = WO<i+1>
	      SecondLotNum          = LotNum<i+1>
	      SecondRecipeInfo      = RecipeInfo<i+1>
		   SecondSpecType        = SpecType<i+1>
	      SecondRONum           = RONum<i+1>
		   SecondRdsId           = RdsIds<i+1>
		   SecondThickPrintVar   = ThickPrintVar<i+1>
		   SecondResPrintVar     = ResPrintVar<i+1>
		   SecondMultiLayVar     = MultiLayVar<i+1>
		   SecondSRPPrintVar     = SRPPrintVar<i+1>
		   SecondSRPTypePrintVar = SRPTypePrintVar<i+1>
		   SecondQty             = Qtys<i+1>
		   
	      if SecondRdsId then
	         SecondWO     = 'WO#':SecondWO
  	         SecondLotNum = 'Lot#':SecondLotNum
	         SecondRONum  = 'RO#':SecondRONum
	         SecondRdsId  = 'RDS#':SecondRdsId
	         SecondThickPrintVar = 'Thk:':SecondThickPrintVar
	         SecondResPrintVar = 'Res:':SecondResPrintVar
	      end
	      *LineOut = fmt( 'Qty:':FirstQty, 'L#6' ):fmt( FirstSpecType, 'C#29' ):fmt( '', 'L#8'):fmt( 'Qty:':SecondQty, 'L#6' ):fmt( SecondSpecType, 'C#29' )
         Font<1> = 'MS LineDraw'
         Void = set_printer( 'FONT', Font )	      
         LineOut = fmt( '(':FirstThickTarget:FirstThickUnit:')(':FirstResTarget:FirstResUnit:')', 'L#25' ):fmt( FirstSpecType, 'R#11' ):fmt( '', 'L#8'):fmt( '(':SecondThickTarget:SecondThickUnit:')(':SecondResTarget:SecondResUnit:')', 'L#25' ):fmt( SecondSpecType, 'R#11' )	      
	      Void = set_printer( 'TEXT', LineOut )
         Font<1> = 'Courier New'
         Void = set_printer( 'FONT', Font )	      
	      
	      if FirstMultiLayVar then
	         LineOut = fmt( 'MULTI-LAYER VIEW-RDS', 'L#21'):' ':fmt( 'Reactor#_____', 'R#13' ):fmt( '', 'L#8' )
	      end else
 	         LineOut = fmt( 'Reactor#_____', 'R#35' ):fmt( '', 'L#8' )
	      end 
	      
	      if SecondMultiLayVar then
            LineOut := fmt( 'MULTI-LAYER VIEW-RDS', 'L#21'):' ':fmt( 'Reactor#_____', 'R#13' )	         
	      end else
	         LineOut := fmt( 'Reactor#_____', 'R#35' )
	      end
	      Void = set_printer( 'TEXT', LineOut )
	      
	      LineOut = fmt( FirstCustAbbrev, 'L#28' ):fmt( '', 'L#1'):fmt( 'RO#':FirstRONum, 'R#6' )
	      LineOut:= fmt( '', 'L#8' )
	      LineOut:= fmt( SecondCustAbbrev, 'L#28' ):fmt( '', 'L#1'):fmt( SecondRONum, 'R#6' )
         Void = set_printer( 'TEXT', LineOut )
         
  	      *LineOut = fmt( 'Qty:':FirstQty, 'L#6' ):fmt( FirstSpecType, 'C#29' ):fmt( '', 'L#8'):fmt( 'Qty:':SecondQty, 'L#6' ):fmt( SecondSpecType, 'C#29' )
	      LineOut = fmt( 'WO#':FirstWo, 'L#10' ):fmt( 'Qty:':FirstQty, 'C#14' ):fmt( 'RDS#':FirstRdsId, 'R#11' )
	      LineOut:= fmt( '', 'L#8' )
	      LineOut:= fmt( SecondWO, 'L#10' ):fmt( 'Qty:':SecondQty, 'C#14' ):fmt( SecondRdsId, 'R#11' )
         Void = set_printer( 'TEXT', LineOut )
         
	      LineOut = fmt( 'Lot#':FirstLotNum, 'L#27' ):fmt( '', 'L#16'):fmt( SecondLotNum, 'L#27' )
         Void = set_printer( 'TEXT', LineOut )
         
	      LineOut = fmt( FirstRecipeInfo, 'L#27' ):fmt( '', 'L#16'):fmt( SecondRecipeInfo, 'L#27' )
         Void = set_printer( 'TEXT', LineOut )
         
	      LineOut = fmt( 'Thk:':FirstThickPrintVar, 'L#27' ):fmt( '', 'L#16'):fmt( SecondThickPrintVar, 'L#27' )
         Void = set_printer( 'TEXT', LineOut )
           	      	      
  	      LineOut = fmt( 'Res:':FirstResPrintVar, 'L#27' ):fmt( '', 'L#16'):fmt( SecondResPrintVar, 'L#27' )
         Void = set_printer( 'TEXT', LineOut )
         
         * SET UP PRINT POSITIONS FOR THE SRP FLAG
         Void = set_printer("LINESTYLE", PS_SOLID:@fm:3)
         LabelRowCnt += 1         
         if ( FirstSRPPrintVar ) or ( SecondSRPPrintVar ) then
	         begin case
	            case LabelRowCnt = 1
	               FirstElipsePos  = 2.31:@fm:.63:@fm:2.94:@fm:1.22
	               FirstSRPPos     = 2.41:@fm:.78
	               FirstTypePos    = 2.47:@fm:.97 
	               SecondElipsePos = 5.83:@fm:.63:@fm:6.47:@fm:1.22
	               SecondSRPPos    = 5.91:@fm:.78
	               SecondTypePos   = 5.97:@fm:.97
	            case LabelRowCnt = 2
	               FirstElipsePos  = 2.31:@fm:2.06:@fm:2.94:@fm:2.66
	               FirstSRPPos     = 2.41:@fm:2.22
	               FirstTypePos    = 2.47:@fm:2.41 	                
	               SecondElipsePos = 5.83:@fm:2.06:@fm:6.47:@fm:2.66
	               SecondSRPPos    = 5.91:@fm:2.22
	               SecondTypePos   = 5.97:@fm:2.41	               
	            case LabelRowCnt = 3
	               FirstElipsePos  = 2.31:@fm:3.56:@fm:2.94:@fm:4.16
	               FirstSRPPos     = 2.41:@fm:3.72
	               FirstTypePos    = 2.47:@fm:3.91
	               SecondElipsePos = 5.83:@fm:3.56:@fm:6.47:@fm:4.16
	               SecondSRPPos    = 5.91:@fm:3.72
	               SecondTypePos   = 5.97:@fm:3.91
	            case LabelRowCnt = 4
	               FirstElipsePos  = 2.31:@fm:5.03:@fm:2.94:@fm:5.63
	               FirstSRPPos     = 2.41:@fm:5.19
	               FirstTypePos    = 2.47:@fm:5.38
	               SecondElipsePos = 5.83:@fm:5.03:@fm:6.47:@fm:5.63
	               SecondSRPPos    = 5.91:@fm:5.19
	               SecondTypePos   = 5.97:@fm:5.38
	            case LabelRowCnt = 5
	               FirstElipsePos  = 2.31:@fm:6.5:@fm:2.94:@fm:7.06
	               FirstSRPPos     = 2.41:@fm:6.63
	               FirstTypePos    = 2.47:@fm:6.82
	               SecondElipsePos = 5.83:@fm:6.5:@fm:6.47:@fm:7.06
	               SecondSRPPos    = 5.91:@fm:6.63
	               SecondTypePos   = 5.97:@fm:6.82
	            case LabelRowCnt = 6
	               FirstElipsePos  = 2.31:@fm:8:@fm:2.94:@fm:8.56
	               FirstSRPPos     = 2.41:@fm:8.13
	               FirstTypePos    = 2.47:@fm:8.32
	               SecondElipsePos = 5.83:@fm:8:@fm:6.47:@fm:8.56
	               SecondSRPPos    = 5.91:@fm:8.13
	               SecondTypePos   = 5.97:@fm:8.32	               
	            case LabelRowCnt = 7
	               FirstElipsePos  = 2.31:@fm:9.44:@fm:2.94:@fm:10
	               FirstSRPPos     = 2.41:@fm:9.56
	               FirstTypePos    = 2.47:@fm:9.75
	               SecondElipsePos = 5.83:@fm:9.44:@fm:6.47:@fm:10
	               SecondSRPPos    = 5.91:@fm:9.56
	               SecondTypePos   = 5.97:@fm:9.75
	         end case
	         if FirstSRPPrintVar then
					stat = set_Printer("ELLIPSE", FirstElipsePos, 0)
					Font<2> = 18
					Void = set_printer( 'FONT', Font )
					Void = set_printer( 'TEXTXY', 'SRP', FirstSRPPos, '', 0 )
				   Font<2> = 10
					Void = set_printer( 'FONT', Font )
					if len( FirstSRPTypePrintVar ) = 2 then
					   FirstSRPTypePrintVar = fmt( FirstSRPTypePrintVar, 'R#3' )
					end
					Void = set_printer( 'TEXTXY', FirstSRPTypePrintVar, FirstTypePos, '', 0 )				   
	         end
	         if SecondSRPPrintVar then
					stat = set_Printer("ELLIPSE", SecondElipsePos, 0)
					Font<2> = 18
					Void = set_printer( 'FONT', Font )
					Void = set_printer( 'TEXTXY', 'SRP', SecondSRPPos, '', 0 )
				   Font<2> = 10
					Void = set_printer( 'FONT', Font )
					if len( SecondSRPTypePrintVar ) = 2 then
					   SecondSRPTypePrintVar = fmt( SecondSRPTypePrintVar, 'R#3' )
					end
					Void = set_printer( 'TEXTXY', SecondSRPTypePrintVar, SecondTypePos, '', 0 )
	         end
	      end
         LabelPrintCount += 2
	      if LabelPrintCount = 14 then
	         Void = set_printer( 'PAGEBREAK' )
	         LabelPrintCount = 0
	         LabelRowCnt = 0
	      end else
			   *Font<2> = 8
				*Void = set_printer( 'FONT', Font )				   
	         for j = 1 to 2
	            Void = set_printer( 'TEXT' )
	         next j
			   *Font<2> = 10
				*Void = set_printer( 'FONT', Font )				   
	      end
	      if LabelRowCnt = 2 then
	          Void = set_printer( 'TEXT', '' )
	      *   Font<2> = 5
	      *   Void = set_printer( 'FONT', Font )
	      *   Void = set_printer( 'TEXT', '' )
	      *   Font<2> = 10
	      *   Void = set_printer( 'FONT', Font )
	      end                      
	   next i 
return
*===========================================================================*
PrintWOLabels:
   * GOT ALL DATA NOW WE CAN PRINT     
   Font = "Courier New,52,L,0"
   convert ',' to @fm in Font
   Void = set_printer( 'FONT', Font )
	Font<2> = 18
	Void = set_printer( 'FONT', Font )
	Void = set_printer( 'TEXT', '' )
	Font<2> = 52
	Void = set_printer( 'FONT', Font )
   LabelPrintCount = 0
   LabelRowCnt     = 0
   UniqueWOs       = UniqueWOs:@vm:UniqueWOs
   UWOCnt = fieldcount( UniqueWOs, @vm )
   for i = 1 to UWOCnt step 2
      FirstUniqueWO = UniqueWOs<1,i>
	   SecondUniqueWO = UniqueWOs<1,i+1>
	   LineOut = FirstUniqueWO:fmt( ' ', 'L#2' ):SecondUniqueWO
	   Void = set_printer( 'TEXT', LineOut )
	   LabelRowCnt += 1	   
	   Font<2> = 36
	   Void = set_printer( 'FONT', Font )
	   Void = set_printer( 'TEXT', '' )
	   if ( LabelRowCnt = 3 ) then
	      Font<2> = 18
	      Void = set_printer( 'FONT', Font )
	      Void = set_printer( 'TEXT', '' )
	   end
	   Font<2> = 52
	   Void = set_printer( 'FONT', Font )
	   if ( LabelRowCnt = 7 ) then
	      Void = set_printer( 'PAGEBREAK' )
	      RowsPrinted = 0
	   end
   next i 
   Void = set_printer( 'TERM' )
return
*===========================================================================*
