compile function print_car( CarId )
begin condition 
pre:
post:
end condition
$insert company_equ
$insert car_equ
$insert logical
$insert msg_equates
$insert popup_equates
$insert oiprint_equates
declare function fieldcount, msg, key_sort, set_printer, dialog_box, entid
declare function repository, next_key
declare subroutine extract_si_keys, record_lock
* THIS PROGRAM WAS NEVER FINISHED OR USED
* OK
Void = set_printer( 'INIT', '', '', '', 0 )
Font = "Courier New,9,L,1"
convert ',' to @fm in Font
Tfont = Font
Stat = set_printer( 'FONT', Font )
CarRec = xlate( 'CAR', CarId, '', 'X' )
Tfont<3> = 'C'
Tfont<2> = 12
Void = set_printer( 'FONT', Tfont )
Void = set_printer( 'TEXT', 'EPITRONICS SILICON DIVISION' )
Void = set_printer( 'TEXT', '' )
Void = set_printer( 'TEXT', 'RUN DATA SHEET' )
for j = 1 to 4
    Void = set_printer( 'TEXT', '' )
next j
stat = set_printer( 'LINESTYLE', ps_solid:@fm:1 ) 
stat = set_printer( 'LINE', 0:@fm:1:@fm:7.5:@fm:1, 0 )
stat = set_printer( 'LINESTYLE', ps_solid:@fm:0 )     
Tfont<2> = 10
Tfont<3> = 'L'
Void = set_printer( 'FONT', Tfont )
Lout = fmt( 'RUN#: ':ThisRdsRec<rds_reactor$>:'-':ThisRdsId, 'L#35' )
Lout:= fmt( 'KEY#: ':ThisRdsId, 'L#35' )
Lout:= 'DATE: ':oconv( ThisRdsRec<rds_date_out$>, 'D2/' )
Void = set_printer( 'TEXT', Lout ) 
Void = set_printer( 'TEXT', '' )
Lout = fmt( 'CUSTOMER: ':oconv( ThisRdsRec<rds_cust_no$>, '[XLATE_CONV,COMPANY*CO_NAME]' ), 'L#63' )
Lout:= fmt( 'PO#:', 'L#6' ):ThisRdsRec<rds_po$>
Void = set_printer( 'TEXT', Lout )
Lout = fmt( '', 'L#63' ):fmt( 'WO#:', 'L#6' ):ThisRdsRec<rds_wo$>
Void = set_printer( 'TEXT', Lout )
Lout = fmt( 'RECIPE: ':oconv( ThisRdsRec<rds_recipe_no$>, '[XLATE_CONV,RECIPE*RECIPE_NAME]' ), 'L#32' )
Lout:= fmt( 'REACTOR: ':xlate( 'RDS', ThisRdsId, 'REACTOR', 'X' ), 'L#31' )
Lout:= fmt( 'PART#:', 'L#6' ):ThisRdsRec<rds_part_num$>
Void = set_printer( 'TEXT', Lout )
Lout = fmt( '', 'L#63' ):fmt( 'LOT#:', 'L#6' ):ThisRdsRec<rds_lot_num$>
Void = set_printer( 'TEXT', Lout )
Void = set_printer( 'TEXT', '' )
Tfont<1> = 'MS LineDraw'
Tfont<2> = 9
Tfont<4> = 200
Void = set_printer( 'FONT', Tfont )
Table = ''
Tline = ',Minimum,Target,Maximum'
Table<-1> = TLine
Tline = 'Thickness,':oconv( ThisRdsRec<rds_thick_min$>, 'MD2' ):' ':ThisRdsRec<rds_thick_units$>:','
Tline:= oconv( ThisRdsRec<rds_thick_target$>, 'MD2' ):' ':ThisRdsRec<rds_thick_units$>:','
Tline:= oconv( ThisRdsRec<rds_thick_max$>, 'MD2' ):' ':ThisRdsRec<rds_thick_units$>	
Table<-1> = Tline
Tline = 'Resistivity,':oconv( ThisRdsRec<rds_res_min$>, 'MD2' ):' ':ThisRdsRec<rds_res_units$>:','
Tline:= oconv( ThisRdsRec<rds_res_target$>, 'MD2' ):' ':ThisRdsRec<rds_res_units$>:','
Tline:= oconv( ThisRdsRec<rds_res_max$>, 'MD2' ):' ':ThisRdsRec<rds_res_units$>	
Table<-1> = Tline
Tline = 'Concentration,':oconv( ThisRdsRec<rds_con_min$,1>, 'MS21' ):' ':ThisRdsRec<rds_con_units$>:','
Tline:= oconv( ThisRdsRec<rds_con_target$,1>, 'MS21' ):' ':ThisRdsRec<rds_con_units$>:','
Tline:= oconv( ThisRdsRec<rds_con_max$,1>, 'MS21' ):' ':ThisRdsRec<rds_con_units$>
Table<-1> = TLine	
Tline = ',':oconv( ThisRdsRec<rds_con_min$,2>, 'MS21' ):' ':ThisRdsRec<rds_con_units$>:','
Tline:= oconv( ThisRdsRec<rds_con_target$,2>, 'MS21' ):' ':ThisRdsRec<rds_con_units$>:','
Tline:= oconv( ThisRdsRec<rds_con_max$,1>, 'MS21' ):' ':ThisRdsRec<rds_con_units$>
Table<-1> = TLine
convert ',' to @vm in Table
x = Set_Printer("TABLE", Table, '', 3:@fm:1.38:@fm:1.38:@fm:1.38, 'L':@fm:'C':@fm:'C':@fm:'C', TB_ALL)
Tfont<1> = 'Courier New' 
Tfont<2> = 10
Tfont<3> = 'L'
Tfont<4> = 1
Void = set_printer( 'FONT', Tfont )
Void = set_printer( 'TEXT', '' ) 
Lout = fmt( 'TIME IN:', 'L#10' ):fmt( oconv( ThisRdsRec<rds_time_in$>, 'MTH' ), 'L#15' ):' '
Lout:= fmt( 'OPERATOR IN:', 'L#14' ):fmt( oconv( ThisRdsRec<rds_operator_in$>, '[XLATE_CONV,LSL_USERS*FIRST_LAST]' ), 'L#20' ):' '
Lout:= fmt( 'WAFERS IN:', 'L#17' ):fmt( ThisRdsRec<rds_wafers_in$>, 'R#2' )
Void = set_printer( 'TEXT', Lout ) 
Lout = fmt( 'TIME OUT:', 'L#10' ):fmt( oconv( ThisRdsRec<rds_time_out$>, 'MTH' ), 'L#15' ):' '
Lout:= fmt( 'OPERATOR OUT:', 'L#14' ):fmt( oconv( ThisRdsRec<rds_operator_out$>, '[XLATE_CONV,LSL_USERS*FIRST_LAST]' ), 'L#20' ):' '
Lout:= fmt( 'WAFERS OUT:', 'L#17' ):fmt( ThisRdsRec<rds_wafers_out$>, 'R#2' )
Void = set_printer( 'TEXT', Lout )
Tvar = 'WAFERS REJECTED: ':fmt( xlate( 'RDS', ThisRdsId, 'TOT_REJ', 'X' ), 'R#2' )
Lout = fmt( '', 'L#61' ):Tvar
Void = set_printer( 'TEXT', Lout )
Void = set_printer( 'TEXT', '' )
Lout = 'INSPECTION( Light Point Defects ) BEFORE:':fmt( oconv( ThisRdsRec<rds_lpd_in$>, 'MD1' ), 'R#6' )
QxjPost = ThisRdsRec<rds_qxj_post$>
QxjPre  = ThisRdsRec<rds_qxj_pre$>
if ( QxjPost <> '' ) or ( QxjPre <> '' ) then
 Lout := fmt( '', 'L#2' ):'QXJ Pre: ':fmt( oconv(QxjPre,'MD2'), 'R#5' ):fmt( '', 'L#2' ):'QXJ Post: ':fmt( oconv(QxjPost,'MD2'), 'R#5' )
end
Void = set_printer( 'TEXT', Lout )
Lout = fmt( '', 'L#35' ):'AFTER:':fmt( oconv( ThisRdsRec<rds_lpd_out$>, 'MD1' ), 'R#6' )
Void = set_printer( 'TEXT', Lout )
Void = set_printer( 'TEXT', '' )
Lout = fmt( '', 'L#11' ):'THICKNESS':fmt( '', 'L#3'):'SHEET RHO':fmt( '', 'L#2'):'RESISTIVITY'
Lout:= fmt( '', 'L#13' ):'STATISTICAL INFORMATION'
Void = set_printer( 'TEXT', Lout )
Tfont<1> = 'MS LineDraw'
Tfont<2> = 9
Tfont<4> = 0
Void = set_printer( 'FONT', Tfont )
ReadingText      = '80MM/70MM/60MM/50MM/40MM/30MM/20MM/10MM/CENTER/10MM/'
ReadingText     := '20MM/30MM/40MM/50MM/60MM/70MM/80MM'
convert '/' to @vm in ReadingText 
ThickReadings    = ThisRdsRec<rds_thick_read$>
SheetRhoReadings = ThisRdsRec<rds_sheetrho_read$>
ResReadings      = xlate( 'RDS', ThisRdsId, 'RES_READ', 'X' )
CustTots         = ''
CustTotsDesc     = 'THICK AVG:/THICK STDEV:/THICK MAX:/THICK MIN:/THICK UNIF:/'
CustTotsDesc    := '/THICK Cp:/THICK Cpk://RES AVG:/RES STDEV:/RES MAX:/'
CustTotsDesc    := 'RES MIN:/RES UNIF://RES Cp:/RES Cpk:'
convert '/' to @vm in CustTotsDesc
CustTots<1,1>    = oconv( ThisRdsRec<rds_tthick_avg$>, 'MD2' ):' '
CustTots<1,2>    = oconv( ThisRdsRec<rds_tthick_stdev$>, 'MD3' ):' '
CustTots<1,3>    = oconv( ThisRdsRec<rds_tthick_max$>, 'MD2' ):' '
CustTots<1,4>    = oconv( ThisRdsRec<rds_tthick_min$>, 'MD2' ):' '
CustTots<1,5>    = oconv( ThisRdsRec<rds_tthick_unif$>, 'MD2' ):'%'
CustTots<1,6>    = ''
CustTots<1,7>    = oconv( ThisRdsRec<rds_tthick_cp$>, 'MD2' ):' '
CustTots<1,8>    = oconv( ThisRdsRec<rds_tthick_cpk$>, 'MD2' ):' '
CustTots<1,9>    = ''
CustTots<1,10>   = oconv( ThisRdsRec<rds_tres_avg$>, 'MD2' ):' '
CustTots<1,11>   = oconv( ThisRdsRec<rds_tres_stdev$>, 'MD3' ):' '
CustTots<1,12>   = oconv( ThisRdsRec<rds_tres_max$>, 'MD2' ):' '
CustTots<1,13>   = oconv( ThisRdsRec<rds_tres_min$>, 'MD2' ):' '
CustTots<1,14>   = oconv( ThisRdsRec<rds_tres_unif$>, 'MD2' ):'%'
CustTots<1,15>   = ''
CustTots<1,16>   = oconv( ThisRdsRec<rds_tres_cp$>, 'MD2' ):' '
CustTots<1,17>   = oconv( ThisRdsRec<rds_tres_cpk$>, 'MD2' ):' '
Table = ''
for j = 1 to 17
    Tvar = ReadingText<1,j>:',':oconv( ThickReadings<1,j>, 'MD2' ):',':SheetRhoReadings<1,j>:','
    Tvar:= oconv( ResReadings<1,j>, 'MD2' ):',,'
    Tvar:= fmt( CustTotsDesc<1,j>, 'L#16'):' ':fmt( CustTots<1,j>, 'R#8' )
    if i = 5 or i = 14 then
        Tvar:= '%'
    end
    Table<j> = Tvar
next j
convert ',' to @vm in Table
x = Set_Printer("TABLE", Table, '', .75:@fm:1:@fm:1:@fm:1:@fm:1:@fm:2, 'R':@fm:'R':@fm:'R':@fm:'R':@fm:'R':@fm:'L', TB_ALL)
Void = set_printer( 'TEXT', '' )
Tfont<1> = 'Courier New' 
Tfont<2> = 10
Tfont<3> = 'C'
Tfont<4> = 1
Tfont<6> = 1
Void = set_printer( 'FONT', Tfont )
Void = set_printer( 'TEXT', 'COMMENTS' )
Tfont<3> = 'L'
Tfont<6> = 0
Void = set_printer( 'FONT', Tfont )
*Comments = ThisRdsRec<rds_comments$>
*convert @tm to ' ' in Comments
*Comments = fmt( Comments, 'T#85' )
*convert @tm to @fm in Comments
*Ccnt = fieldcount( Comments, @fm )
*for j = 1 to Ccnt
*    Void = set_printer( 'TEXT', Comments<j> )
*next j
* removed comments cause below it will print the actual loss codes and
* quantities and the operator will type this into the comments section
* which would be duplicate information for the customer. 
RejString = ''
* LSL Pre Epi
LPreRej     = xlate( 'RDS', ThisRdsId, 'L_PRE_REJ_CNT', 'X' )
LPreRejLoss = xlate( 'RDS', ThisRdsId, 'L_PRE_REJ_LOSS_DESC', 'X' )    
Tcnt = fieldcount( LPreRej, @vm )
for j = 1 to Tcnt
   RejString := LPreRej<1,j>:' LSL Pre Epi Reject(s) for ':LPreRejLoss<1,j>:';'
next j
* LSL Post Epi
LPostRej     = xlate( 'RDS', ThisRdsId, 'L_POST_REJ_CNT', 'X' )
LPostRejLoss = xlate( 'RDS', ThisRdsId, 'L_POST_REJ_LOSS_DESC', 'X' )
Tcnt = fieldcount( LPostRej, @vm )
for j = 1 to Tcnt
   RejString := ' ':LPostRej<1,j>:' LSL Post Epi Reject(s) for ':LPostRejLoss<1,j>:';'
next j
* Cust Pre Epi
CPreRej     = xlate( 'RDS', ThisRdsId, 'C_PRE_REJ_CNT', 'X' )
CPreRejLoss = xlate( 'RDS', ThisRdsId, 'C_PRE_REJ_LOSS_DESC', 'X' )
Tcnt = fieldcount( CPreRej, @vm )
for j = 1 to Tcnt
   RejString := ' ':CPreRej<1,j>:' Customer Pre Epi Reject(s) for ':CPreRejLoss<1,j>:';'
next j
* Cust Post Epi
CPostRej     = xlate( 'RDS', ThisRdsId, 'C_POST_REJ_CNT', 'X' )
CPostRejLoss  = xlate( 'RDS', ThisRdsId, 'C_POST_REJ_LOSS_DESC', 'X' )
Tcnt = fieldcount( CPostRej, @vm )
for j = 1 to Tcnt
   RejString := ' ':CPostRej<1,j>:' Customer Post Epi Reject(s) for ':CPostRejLoss<1,j>:';'
next j    
RejString[-1,1] = ''
RejString = fmt( RejString, 'T#85' )
convert @tm to @fm in RejString
Tcnt = fieldcount( RejString, @fm )
for j = 1 to Tcnt
    Void = set_printer( 'TEXT', RejString<j> )
next j 
if i = Rcnt else 
    Void = set_printer( 'PAGEBREAK' )
end  
Void = set_printer( 'TERM' )
return 0 
