New MARC display routines.
[ir-tcl-moved-to-github.git] / formats / raw.tcl
1
2 proc display-raw {sno no w} {
3     $w delete 0.0 end
4     set r [z39.$sno getMarc $no list * * *]
5     foreach line $r {
6         set tag [lindex $line 0]
7         set indicator [lindex $line 1]
8         set fields [lindex $line 2]
9         
10         if {$indicator != ""} {
11             insertWithTags $w "$tag $indicator" marc-tag
12         } else {
13             insertWithTags $w "$tag    " marc-tag
14         }
15         foreach field $fields {
16             set id [lindex $field 0]
17             set data [lindex $field 1]
18             if {$id != ""} {
19                 insertWithTags $w " $id " marc-id
20             }
21             set start [$w index insert]
22             insertWithTags $w $data {}
23         }
24         $w insert end "\n"
25     }
26 }
27