Minor presentation format changes.
[ir-tcl-moved-to-github.git] / formats / raw.tcl
1 # IR toolkit for tcl/tk
2 # (c) Index Data 1995
3 # See the file LICENSE for details.
4 # Sebastian Hammer, Adam Dickmeiss
5 #
6 # $Log: raw.tcl,v $
7 # Revision 1.3  1995-06-14 12:16:42  adam
8 # Minor presentation format changes.
9 #
10 # Revision 1.2  1995/06/12  15:18:10  adam
11 # Work on presentation formats. These are used in the main window as well
12 # as popup windows.
13 #
14 #
15 proc display-raw {sno no w hflag} {
16     if {$hflag} {
17         insertWithTags $w "\n$no\n" {}
18     } else {
19         $w delete 0.0 end
20     }
21     set r [z39.$sno getMarc $no list * * *]
22     foreach line $r {
23         set tag [lindex $line 0]
24         set indicator [lindex $line 1]
25         set fields [lindex $line 2]
26         
27         if {$indicator != ""} {
28             insertWithTags $w "$tag $indicator" marc-tag
29         } else {
30             insertWithTags $w "$tag    " marc-tag
31         }
32         foreach field $fields {
33             set id [lindex $field 0]
34             set data [lindex $field 1]
35             if {$id != ""} {
36                 insertWithTags $w " $id " marc-id
37             }
38             set start [$w index insert]
39             insertWithTags $w $data {}
40         }
41         $w insert end "\n"
42     }
43 }
44