1
<HTML><HEAD><TITLE>Answer to Exercise 68</TITLE></HEAD>
2
<BODY BGCOLOR="#FFFFFF">
3
<TABLE><TR><TD Valign="top"><IMG SRC="../icons/exercise.gif" ALT="??"><TD bgcolor="#FAA89B"><B>ANSWER TO EXERCISE 68</B><TR><TD><TD>
7
Constant MAX_FOOTNOTES 10;
8
Array footnotes_seen -> MAX_FOOTNOTES;
11
for (i=0:i<footnote_count:i++)
12
if (n==footnotes_seen->i) pn=i;
13
if (footnote_count==MAX_FOOTNOTES) "** MAX_FOOTNOTES exceeded! **";
14
if (pn==0) { pn=footnote_count++; footnotes_seen->pn=n; }
18
if (noun>footnote_count)
19
"No footnote [", noun, "] has been mentioned.";
20
if (noun==0) "Footnotes count upward from 1.";
21
n=footnotes_seen->(noun-1);
24
{ 0: "This is a footnote.";
25
1: "D.G.REG.F.D is inscribed around English coins.";
26
2: "~Jackdaws love my big sphinx of quartz~, for example.";
29
Verb "footnote" "note" * number -> Footnote;
32
And then you can code, for instance,
34
print "Her claim to the throne is in every pocket ", (Note) 1,
35
", her portrait in every wallet.";
39
<HR>Back to <A HREF="../section27.html#ex68">the exercise in section 27</A><HR>
40
<SMALL><I>Mechanically translated to HTML from third edition as revised 16 May 1997. Copyright © Graham Nelson 1993, 1994, 1995, 1996, 1997: all rights reserved.</I></SMALL></BODY></HTML>