4
* @author Paul B. McBride (pbm%cybvax0@uunet.uu.net)
9
report program subroutine library for handling SOURces.
11
add the following lines to your source program to use this library of
14
include("quicksort.ll")
15
include("compare.ll") [define your own compare if necessary]
19
27-feb-96 v4.1 - Indent PUBL info properly. Set source to LDS-AF if AFN seen.
20
14-feb-96 v4 - Use quicksort() to sort sources by REFN value
21
08-feb-96 v3 - Support REPO records
22
24-jan-96 v1.2 - GEDCOM 5.5 support and compatibility notes
23
Correct processing of Sources without REFN tags
24
03-oct-95 v1.1 - sour_addset() now adds sources for families of individuals
27
LifeLines 3.0.2 or later (I hope)
30
- Add routines to report sources as references to footnotes, and
31
list sources in foot notes. Also report source citation detail
33
- Add support for repository records (REPO) to replace non standard
34
location (LOCA) records.
36
See Examples of using the library routines below.
38
Tags within SOUR definitions which are processed by sour_ref():
46
PUBL publisher information
48
EDIT which edition, revision, etc
49
VOLU number of volumnes (e.g. 3 vols)
51
PLAC place of publication
52
REPO LOCA where you saw this source (repository)
54
TEXT text quoted from document
56
The GEDCOM 5.5 standard combines all of the publication related info
57
into the PUBL tag line with continuations (CONT). It introduces
58
a repository structure which includes the NAME and address (ADDR structure)
59
of the location where the source can be viewed.
61
The following describes how I use the REFN tag. This is not particularly
62
relevant, but here goes.
64
There are some standard abbreviations that are often used:
65
MD Mayflower Descendant
66
NEHGR New England Historic Genealogical Society Register
67
TAG The Americant Genealogist
68
RFC Royalty for Commoners
69
AR7 Ancestral Roots... 7th edition
70
I use other REFN's which are a combination of the subject, or author
72
WentworthG Wentworth Genealogy
73
HayesFH a Hayes family history
74
ScituateVR Scituate, MA Vital Records
75
HamptonTH Hampton, NH Town History
77
When I am entering a source field I would then enter it as:
81
and it will get converted to
87
1) Report references used in a set of individuals
91
call sour_init() / * initialize the current source list and table * /
92
... / * create a set of individuals * /
93
call sour_addset(a_set) / * add all sources referenced by set * /
94
"References: " nl() nl()
95
call sour_ref(10) / * report details of all sources * /
97
2) List references for groups of individuals, and then a master
98
list of all sources referenced:
104
...for each group of individuals
105
{ call sour_init() / * initialize the current source list and table * /
106
...for each individual...
107
{ call sour_addind(an_indi)
110
call sour_see(",", 70, 10) / * report REFN of each source * /
111
call sour_save(my_table, my_list) / * add to master list * /
115
/ * make master list the current list of sources * /
116
call sour_restore(my_table, my_list)
118
"Key to References:" nl() nl()
119
call sour_ref(10) / * report details for all sources * /
122
3) Output all sources for a set of individuals in GEDCOM format:
126
call sour_init() / * initialize the current source list and table * /
127
... / * create a set of individuals * /
128
call sour_addset(a_set) / * add all sources referenced by set * /
129
call sour_ged() / * output sources in GEDCOM format * /
131
08-sep-95 Paul B. McBride (pbm%cybvax0@uunet.uu.net)
145
forlist(sour_list, v, n) {
146
if (eq(0, lookup(t, v))) {
153
proc sour_restore(t, l)
159
/* sour_add() adds the sources referenced for this individual. This
160
will also work for families
165
traverse(root(i), m, l) {
167
if (eqstr("AFN", tag(m))) {
170
elsif (eqstr("SOUR", tag(m))) {
172
if(not(reference(v))) { set(v, 0) }
175
if (ne(0, lookup(sour_table, v))) { continue() }
177
insert(sour_table, v, 1)
178
enqueue(sour_list, v)
185
forindiset (s, i, a, n) {
187
families(i, f, sp, m) {
193
proc sour_see(sep, maxlen, indent)
197
set(seplen, strlen(sep))
198
forlist(sour_list, k, n) {
199
if(first) { set(first, 0) }
202
set(curlen, add(curlen, seplen))
204
if(eqstr(k, "LDS-AF")) { set(myrefn, k) }
206
set(myrefn, sour_getfield(dereference(k), "REFN"))
207
if(eq(myrefn, 0)) { set(myrefn, k) }
209
set(mylen, add(add(strlen(myrefn), seplen),2))
210
if(and(gt(maxlen, 0), gt(add(curlen, mylen), maxlen))) {
214
call html_lt() /* < */
215
if(eq(html_ext, 0)) { set(html_ext, ".html") }
216
call html_ahref("ref", html_ext, myrefn)
218
call html_tag("/A", 0)
219
call html_gt() /* > */
220
set(curlen, add(curlen, mylen))
223
if(and(HTML, eq(first,0))) {
224
call html_tag("P", 1)
228
proc sour_ref(colnum)
233
/* build list of reference keys */
234
forlist(sour_list, k, n) {
235
if(eqstr(k, "LDS-AF")) { set(refn, k) }
237
set(anode, dereference(k))
238
set(refn, sour_getfield(anode, "REFN"))
239
if(eq(refn, 0)) { set(refn, k) }
241
enqueue(alist, save(refn))
245
call quicksort(alist, ilist)
248
call html_tag("UL", 0)
249
while(n, dequeue(ilist)) {
251
set(k, getel(sour_list, n))
252
call html_tag("LI", 0)
253
call html_tag("PRE", 1)
254
if(eqstr(k, "LDS-AF")) { set(refn, k) set(ldsaf, 1) }
256
set(anode, dereference(k))
257
set(refn, sour_getfield(anode, "REFN"))
258
if(eq(refn, 0)) { set(refn, k) }
260
call html_lt() /* < */
262
call html_gt() /* > */
265
if(ldsaf) { "LDS Ancestral File" }
266
else {sour_repfield(anode, "TITL", colnum) }
269
call html_aname(refn)
271
if(ldsaf) { "." nl() }
273
if(sour_getfield(anode, "AUTH")) {
276
sour_repfield(anode, "AUTH", colnum)
278
set(d, sour_getfield(anode, "DATE"))
280
set(d, sour_getfield(anode, "EDIT"))
282
set(d, sour_getfield(anode, "VOLU"))
284
set(d, sour_getfield(anode, "PAGE"))
286
set(d, sour_getfield(anode, "PUBL"))
287
if(d) { ", " nl() col(colnum) d }
288
set(d, sour_getfield(anode, "PLAC"))
291
if(html_urls(anode, colnum)) { nl() }
292
if(sour_getfield(anode, "NOTE")) {
294
sour_repfield(anode, "NOTE", colnum)
297
if(sour_getfield(anode, "TEXT")) {
299
sour_repfield(anode, "TEXT", colnum)
303
call html_tag("/PRE", 0)
304
call html_tag("/LI", 0)
306
call html_tag("/UL", 0)
311
return(ne(length(sour_list), 0))
314
func sour_getfield(r, t)
317
if (eq(0, strcmp(t, tag(s)))) { return(value(s)) }
322
func sour_repfield(r, t, colnum)
326
if (eq(0,strcmp(t, tag(node)))) {
329
fornodes(node, subnode) {
330
if (eq(0,strcmp("CONT", tag(subnode)))) {
332
if(gt(colnum, 0)) { col(colnum) }
342
/* sour_ged() outputs the current source list in GEDCOM format */
349
forlist(sour_list, k, n) {
351
set(r, dereference(k))
354
if (xref(s)) { " " xref(s) }
359
if (ne(0, lookup(other_table, v))) { continue() }
361
insert(other_table, v, 1)
362
enqueue(other_list, v)
369
forlist(other_list, k, n) {
370
set(r, dereference(k))
373
if (xref(s)) { " " xref(s) }
375
if (v, value(s)) { " " v }