Work on presentation formats. These are used in the main window as well
[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.2  1995-06-12 15:18:10  adam
8 # Work on presentation formats. These are used in the main window as well
9 # as popup windows.
10 #
11 #
12
13 proc display-raw {sno no w hflag} {
14     if {$hflag} {
15         insertWithTags $w "\n$no\n" {}
16     } else {
17         $w delete 0.0 end
18     }
19     set r [z39.$sno getMarc $no list * * *]
20     foreach line $r {
21         set tag [lindex $line 0]
22         set indicator [lindex $line 1]
23         set fields [lindex $line 2]
24         
25         if {$indicator != ""} {
26             insertWithTags $w "$tag $indicator" marc-tag
27         } else {
28             insertWithTags $w "$tag    " marc-tag
29         }
30         foreach field $fields {
31             set id [lindex $field 0]
32             set data [lindex $field 1]
33             if {$id != ""} {
34                 insertWithTags $w " $id " marc-id
35             }
36             set start [$w index insert]
37             insertWithTags $w $data {}
38         }
39         $w insert end "\n"
40     }
41 }
42