# passing of the file  $prt_file to the printer (spool)
#
# Copyright (C) 2004  G. Lamprecht, W. Lotz, R. Weibezahn; IWD, Bremen University

proc printing {f austext} {

  upvar 1 $austext a

  global vv prt_file lpcmd lpopt olsep

  set a ""


  set opt1 [lindex [split $lpopt $olsep] 1]
  set opt2 [lindex [split $lpopt $olsep] 2]

  TestPut 4 "<$lpcmd> <$opt1> <$opt2> <$prt_file>  <<$lpopt><$olsep>>"

  set a "${a}[datime] $vv(dr1)   $lpcmd $opt1 $opt2 $prt_file\n"


  if ![file exists $prt_file] {# file to be printed not found!
      set a "${a}\n\n***** $vv(dr3) \"$prt_file\" $vv(ea4)\n"; mybell 2
  } else {
    eval set res [catch "exec $lpcmd $opt1 $opt2 $prt_file" message]
    set a "${a}$message\n"
    if {$res != 0} {set a "${a}$vv(dr2)=$res\n"}
  }
  TestPut 4 "<$a>" 

}
