Work on presentation formats. These are used in the main window as well
[ir-tcl-moved-to-github.git] / formats / line.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: line.tcl,v $
7 # Revision 1.1  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-line {sno no w hflag} {
14     set type [z39.$sno type $no]
15     if {! $hflag} {
16         $w delete 0.0 end
17     }
18     if {$type == "DB"} {
19         if {$hflag} {
20             set nostr [format "%5d " $no]
21             insertWithTags $w $nostr marc-tag
22         }
23         set title [lindex [z39.$sno getMarc $no field 245 * a] 0]
24         set year  [lindex [z39.$sno getMarc $no field 260 * c] 0]
25         insertWithTags $w "$title - $year\n" marc-data
26         $w tag bind marc-data 
27     } elseif {$type == "SD"} {
28         set err [lindex [z39.$sno diag $no] 1]
29         set add [lindex [z39.$sno diag $no] 2]
30         if {$add != {}} {
31             set add " :${add}"
32         }
33         $w insert end "Error ${err}${add}\n"
34     } elseif {$type == ""} {
35         return
36     }
37 }