Minor changes.
[egate.git] / fml / marc2.fml
1 # FML marc rutines - with passing of code.
2 #
3 # $Id: marc2.fml,v 1.1 1995/02/27 09:01:21 adam Exp $
4 \func case tag indicator identifier \code {
5         \if {{\strcmp \tag \line\index 1}\eq 0} {
6         \if {{\strcmp \indicator \line\index 2}\eq 0} {
7                 \foreach field {\line \index 3} {
8                         \if{{\strcmp \identifier \field\index 1}\eq 0}
9                         {
10                                 \set info {\field \index 2}
11                                 \code
12                         }
13                 }
14         } }
15 }
16
17 \func marc rec \code {
18         \foreach line {\rec} {\code}
19 }
20         
21 \func testfmt record {
22         \marc {\record} {
23                 \case 245 00 a { 24500a: \info\n }
24                 \case 100 00 b { 10000b: \info\n }
25                 \case 101 00 x { }
26                 \case 102 00 x { }
27                 \case 103 00 x { }
28                 \case 104 00 x { }
29                 \case 105 00 x { }
30                 \case 106 00 x { }
31         }
32 }
33
34 \foreach i {1 2 3 4 5 6 7 8 9 10}
35 {
36 \testfmt \list {     
37         { 008 00 {
38                 { b {a b c d e f} } 
39                 { c {a b c d e f} } 
40         } }
41         { 100 00 {
42                 { b {Felt 100-b} } 
43                 { c {felt 100-c} } 
44         } }
45         { 245 00 {
46                 { a {Felt 245-x} } 
47         } }
48         { 260 00 {
49                 { b {Felt 100-b} } 
50                 { c {felt 100-c} } 
51         } }
52         { 970 00 {
53                 { b {Felt 100-b} } 
54                 { c {felt 100-c} } 
55         } }
56         { 971 00 {
57                 { b {Felt 100-b} } 
58                 { c {felt 100-c} } 
59         } }
60         { 972 00 {
61                 { b {Felt 100-b} } 
62                 { c {felt 100-c} } 
63         } }
64         { 973 00 {
65                 { b {Felt 100-b} } 
66                 { c {felt 100-c} } 
67         } }
68         { 974 00 {
69                 { b {Felt 100-b} } 
70                 { c {felt 100-c} } 
71         } }
72 }
73 }