Minor presentation format changes.
[ir-tcl-moved-to-github.git] / formats / medium.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: medium.tcl,v $
7 # Revision 1.4  1995-06-14 12:16:42  adam
8 # Minor presentation format changes.
9 #
10 # Revision 1.3  1995/06/13  14:39:06  adam
11 # Fix: if {$var != ""} doesn't work if var is a large numerical!
12 # Highlight when line format is used.
13 #
14 # Revision 1.2  1995/06/12  15:18:10  adam
15 # Work on presentation formats. These are used in the main window as well
16 # as popup windows.
17 #
18 #
19
20 proc display-medium {sno no w hflag} {
21     if {$hflag} {
22         insertWithTags $w "\n$no\n" marc-data
23     } else {
24         $w delete 0.0 end
25     }
26     set i [z39.$sno getMarc $no field 245 * a]
27     if {"x$i" != "x"} {
28         insertWithTags $w "Title:      " marc-tag
29         insertWithTags $w [string trimright [lindex $i 0] /] marc-data
30         set i [z39.$sno getMarc $no field 245 * b]
31         if {"x$i" != "x"} {
32             insertWithTags $w [string trimright [lindex $i 0] /] marc-data
33         }
34         $w insert end "\n"
35     }
36     set i [z39.$sno getMarc $no field 700 * a]
37     if {"x$i" == "x"} {
38         set i [z39.$sno getMarc $no field 100 * a]
39     }
40     if {"x$i" != "x"} {
41         if {[llength $i] > 1} {
42             insertWithTags $w "Authors:    " marc-tag
43         } else {
44             insertWithTags $w "Author:     " marc-tag
45         }
46         foreach x $i {
47             insertWithTags $w $x marc-data
48         }
49         $w insert end "\n"
50     }
51     set i [z39.$sno getMarc $no field 110 * *]
52     if {"x$i" != "x"} {
53         insertWithTags $w "Co-Author:  " marc-tag
54         foreach x $i {
55             insertWithTags $w $x marc-data
56         }
57         $w insert end "\n"
58     }
59
60     set i [z39.$sno getMarc $no field 650 * *]
61     if {"x$i" != "x"} {
62         set n 0
63         insertWithTags $w "Keywords:   " marc-tag
64         foreach x $i {
65             if {$n > 0} {
66                 $w insert end ", "
67             }
68             insertWithTags $w $x marc-data
69             incr n
70         }
71         $w insert end "\n"
72     }
73     set i [concat [z39.$sno getMarc $no field 260 * a] \
74             [z39.$sno getMarc $no field 260 * b]]
75     if {"x$i" != "x"} {
76         insertWithTags $w "Publisher:  " marc-tag
77         foreach x $i {
78             insertWithTags $w $x marc-data
79         }
80         $w insert end "\n"
81     }
82     set i [z39.$sno getMarc $no field 020 * a]
83     if {"x$i" != "x"} {
84         insertWithTags $w "ISBN:       " marc-tag
85         foreach x $i {
86             insertWithTags $w $x marc-data
87         }
88         $w insert end "\n"
89     }
90     set i [z39.$sno getMarc $no field 022 * a]
91     if {"x$i" != "x"} {
92         insertWithTags $w "ISSN:       " marc-tag
93         foreach x $i {
94             insertWithTags $w $x marc-data
95         }
96         $w insert end "\n"
97     }
98     set i [z39.$sno getMarc $no field 030 * a]
99     if {"x$i" != "x"} {
100         insertWithTags $w "CODEN:      " marc-tag
101         foreach x $i {
102             insertWithTags $w $x marc-data
103         }
104         $w insert end "\n"
105     }
106     set i [z39.$sno getMarc $no field 015 * a]
107     if {"x$i" != "x"} {
108         insertWithTags $w "Ctl number: " marc-tag
109         foreach x $i {
110             insertWithTags $w $x marc-data
111         }
112         $w insert end "\n"
113     }
114     set i [z39.$sno getMarc $no field 010 * a]
115     if {"x$i" != "x"} {
116         insertWithTags $w "LC number:  " marc-tag
117         foreach x $i {
118             insertWithTags $w $x marc-data
119         }
120         $w insert end "\n"
121     }
122 }