1 <!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
4 <meta http-equiv=
"Content-Type" content=
"text/html; charset=UTF-8">
5 <meta http-equiv=
"Content-Style-Type" content=
"text/css">
7 <meta name=
"Generator" content=
"Cocoa HTML Writer">
8 <meta name=
"CocoaVersion" content=
"1038.25">
9 <style type=
"text/css">
10 p
.p1
{margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica
}
11 p
.p2
{margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica
; min-height: 14.0px}
12 p
.p3
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; min-height: 12.0px}
13 p
.p4
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #bf0000; min-height: 12.0px}
14 p
.p5
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #bf0000}
15 p
.p6
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
}
16 p
.p7
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #0000bf}
17 p
.p8
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #606060}
18 p
.p9
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #606060; min-height: 12.0px}
19 p
.p10
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #000000}
20 p
.p11
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #000000; min-height: 12.0px}
21 span
.s1
{font: 18.0px Helvetica
}
22 span
.s2
{font: 9.0px Monaco
}
23 span
.s3
{text-decoration: underline
; color: #0000bf}
24 span
.s4
{color: #0000bf}
25 span
.s5
{color: #000000}
26 span
.s6
{color: #bf0000}
27 span
.s7
{color: #007300}
28 span
.s8
{color: #606060}
29 span
.s9
{color: #0b28c6}
30 span
.Apple-tab-span
{white-space:pre
}
34 <p class=
"p1"><span class=
"s1"><b>History
</b></span><span class=
"s2"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></span><b>keeps a history of interpreted lines of code
</b></p>
35 <p class=
"p2"><br></p>
36 <p class=
"p1"><b>Inherits from:
</b> <a href=
"../../../Core/Object.html"><span class=
"s3">Object
</span></a></p>
37 <p class=
"p2"><br></p>
38 <p class=
"p1">History keeps track of all code lines that are being executed, in order to forward them to other players, to easily reuse earlier versions, or to store and reproduce a performance. Since it records everything that is interpreted, there is only one privileged instance of History -
<b>History.current.
<span class=
"Apple-converted-space"> </span></b></p>
39 <p class=
"p1">(adc
2006/
7)
</p>
40 <p class=
"p2"><br></p>
41 <p class=
"p2"><br></p>
42 <p class=
"p1"><span class=
"Apple-tab-span"> </span><b>*start / *end
</b><span class=
"Apple-tab-span"> </span>start/end adding interpreted code to (current) history
</p>
43 <p class=
"p2"><span class=
"Apple-tab-span"> </span></p>
44 <p class=
"p1"><span class=
"Apple-tab-span"> </span><b>*clear
</b><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>remove all items from
<span class=
"Apple-converted-space"> </span>(current) history
</p>
45 <p class=
"p2"><span class=
"Apple-tab-span"> </span></p>
46 <p class=
"p1"><span class=
"Apple-tab-span"> </span><b>*enter(obj)
</b><span class=
"Apple-tab-span"> </span>add an entry by hand
</p>
47 <p class=
"p2"><span class=
"Apple-tab-span"> </span></p>
48 <p class=
"p1"><span class=
"Apple-tab-span"> </span><b>*document
</b><span class=
"Apple-tab-span"> </span>post the history in a new document (as story)
</p>
49 <p class=
"p2"><span class=
"Apple-tab-span"> </span></p>
50 <p class=
"p1"><span class=
"Apple-tab-span"> </span><b>*drop(n)
</b><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>drop the newest n lines from history. if n is negative, drop the oldest n lines
</p>
51 <p class=
"p2"><span class=
"Apple-tab-span"> </span></p>
52 <p class=
"p1"><span class=
"Apple-tab-span"> </span><b>*keep(n)
</b><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>keep only the newest n lines from history. if n is negative, keep the oldest n lines
</p>
53 <p class=
"p2"><span class=
"Apple-tab-span"> </span></p>
54 <p class=
"p1"><span class=
"Apple-tab-span"> </span><b>*saveCS(path, forward)
</b><span class=
"Apple-converted-space"> <span class=
"Apple-tab-span"> </span></span></p>
55 <p class=
"p1"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>store history as one compileString
</p>
56 <p class=
"p2"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></p>
57 <p class=
"p1"><span class=
"Apple-tab-span"> </span><b>*loadCS(path, forward)
</b><span class=
"Apple-converted-space"> <span class=
"Apple-tab-span"> </span></span></p>
58 <p class=
"p1"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>load a history from (compilestring) file.
</p>
59 <p class=
"p2"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></p>
60 <p class=
"p1"><span class=
"Apple-tab-span"> </span><b>*saveStory(path)
</b><span class=
"Apple-converted-space"> <span class=
"Apple-tab-span"> </span></span></p>
61 <p class=
"p1"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>store in a file, in historical order as individual code snippets
</p>
62 <p class=
"p2"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></p>
63 <p class=
"p1"><span class=
"Apple-tab-span"> </span><b>*loadStory(path)
</b><span class=
"Apple-converted-space"> <span class=
"Apple-tab-span"> </span></span></p>
64 <p class=
"p1"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>read history into current, from a file in story format
</p>
65 <p class=
"p2"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></p>
66 <p class=
"p1"><span class=
"Apple-tab-span"> </span><b>*play(start, end, verbose)
</b><span class=
"Apple-converted-space"> <span class=
"Apple-tab-span"> </span></span></p>
67 <p class=
"p1"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>play back current history from start to end line, per default verbose
</p>
68 <p class=
"p1"><span class=
"Apple-tab-span"> </span><b>*stop
</b> <span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>stop current history playback.
</p>
69 <p class=
"p2"><span class=
"Apple-tab-span"> </span></p>
70 <p class=
"p1"><span class=
"Apple-tab-span"> </span>*
<b>rewrite(path, open)
</b></p>
71 <p class=
"p1"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>Write a properly formatted code file from a history.
<span class=
"Apple-converted-space"> </span></p>
72 <p class=
"p1"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>The filename is the original name with
<span class=
"Apple-converted-space"> </span>"_rewritten." appended.
</p>
73 <p class=
"p1"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>If open is true (default: true), open a text window with the string.
</p>
74 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
75 <p class=
"p3"><br></p>
76 <p class=
"p4"><br></p>
77 <p class=
"p4"><br></p>
78 <p class=
"p5">// example use:
</p>
79 <p class=
"p3"><br></p>
80 <p class=
"p5"><span class=
"s4">History
</span><span class=
"s5">.clear.end;
<span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></span>// clear to start over
</p>
81 <p class=
"p5"><span class=
"s4">History
</span><span class=
"s5">.start;
<span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></span>// starts recording, opens log file
</p>
82 <p class=
"p3"><br></p>
83 <p class=
"p5"><span class=
"s5"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></span>// execute these lines one by one
<span class=
"Apple-converted-space"> </span></p>
84 <p class=
"p6">1 +
2;
</p>
85 <p class=
"p6">p =
<span class=
"s4">ProxySpace
</span>.push(s.boot);
</p>
86 <p class=
"p6">~a = {
<span class=
"s4">Dust
</span>.ar([
1,
1] *
30 ) *
0.3 };
<span class=
"s6">//
</span></p>
87 <p class=
"p6">~a.play;
</p>
88 <p class=
"p6">~a.end;
</p>
89 <p class=
"p3"><br></p>
90 <p class=
"p5"><span class=
"s4">History
</span><span class=
"s5">.end;
<span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></span>// NOTE: change of interface! History.end ends logging now.
</p>
91 <p class=
"p3"><br></p>
92 <p class=
"p3"><br></p>
93 <p class=
"p5"><span class=
"s4">History
</span><span class=
"s5">.document;
</span>// create a document with all the changes
</p>
94 <p class=
"p3"><br></p>
95 <p class=
"p6"><span class=
"s4">History
</span>.showLogFile;
<span class=
"s6">//
</span></p>
96 <p class=
"p3"><br></p>
97 <p class=
"p5"><span class=
"s5">g =
</span><span class=
"s4">History
</span><span class=
"s5">.makeWin(
0@
20);
</span>// make a gui window, put it where you like
</p>
98 <p class=
"p5"><span class=
"s5">g =
</span><span class=
"s4">History
</span><span class=
"s5">.makeWin(
0@
20,
5);
</span>// lines to see in textview
</p>
99 <p class=
"p3"><br></p>
100 <p class=
"p5"><span class=
"s4">History
</span><span class=
"s5">.play;
<span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></span>// posts lines by default;
</p>
101 <p class=
"p3"><br></p>
102 <p class=
"p5"><span class=
"s4">History
</span><span class=
"s5">.play(verbose:
</span><span class=
"s4">false
</span><span class=
"s5">);
</span>// just do it, no posting;
</p>
103 <p class=
"p3"><br></p>
104 <p class=
"p5"><span class=
"s5"><span class=
"Apple-tab-span"> </span></span>// continue recording
</p>
105 <p class=
"p6"><span class=
"s4">History
</span>.start;
<span class=
"Apple-converted-space"> </span></p>
106 <p class=
"p3"><br></p>
107 <p class=
"p5"><span class=
"s5">10 +
200;
<span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></span>// enter
5 more lines
</p>
108 <p class=
"p6">p.push;
</p>
109 <p class=
"p6">~b = {
<span class=
"s4">|freq=
500|
</span> <span class=
"s4">LFDNoise3
</span>.ar(freq.dup(
2)) *
0.2 };
</p>
110 <p class=
"p6">~b.play;
</p>
111 <p class=
"p6">~b.set(
<span class=
"s7">\freq
</span>,
1000);
</p>
112 <p class=
"p6">~b.end(
2);
</p>
113 <p class=
"p3"><br></p>
114 <p class=
"p7">History
<span class=
"s5">.end;
</span></p>
115 <p class=
"p3"><br></p>
116 <p class=
"p3"><br></p>
117 <p class=
"p5"><span class=
"s5"><span class=
"Apple-tab-span"> </span></span>// save current history to a file.
<span class=
"Apple-converted-space"> </span></p>
118 <p class=
"p8"><span class=
"s4">History
</span><span class=
"s5">.saveCS(
</span>"~/Desktop/TestHist.scd"<span class=
"s5">);
</span></p>
119 <p class=
"p8"><span class=
"s5">h =
</span><span class=
"s4">History
</span><span class=
"s5">.new.loadCS(
</span>"~/Desktop/TestHist.scd"<span class=
"s5">);
</span></p>
120 <p class=
"p6">h.lines.printcsAll;
<span class=
"s8">""</span>;
<span class=
"Apple-converted-space"> </span></p>
121 <p class=
"p3"><br></p>
122 <p class=
"p5"><span class=
"s5"><span class=
"Apple-tab-span"> </span></span>// under the hood: History.someCommand goes to History.current:
</p>
123 <p class=
"p3"><br></p>
124 <p class=
"p5"><span class=
"s5"><span class=
"Apple-tab-span"> </span></span>// History.current is where new codelines always go.
</p>
125 <p class=
"p6">h =
<span class=
"s4">History
</span>.current;
</p>
126 <p class=
"p6">h.lines.printcsAll;
<span class=
"s8">""</span>;
</p>
127 <p class=
"p5"><span class=
"s5">h.lineShorts.printcsAll;
</span><span class=
"s8">""</span><span class=
"s5">;
</span>// lineshorts are for gui display
</p>
128 <p class=
"p3"><br></p>
129 <p class=
"p5"><span class=
"s4">History
</span><span class=
"s5">.enter(
</span><span class=
"s8">"2 + 2"</span><span class=
"s5">);
<span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></span>// make a simple entry by hand.
</p>
130 <p class=
"p6">h.lines.printcsAll;
<span class=
"s8">""</span>;
</p>
131 <p class=
"p3"><br></p>
132 <p class=
"p5"><span class=
"s5"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></span>// one can edit a history:
<span class=
"Apple-converted-space"> </span></p>
133 <p class=
"p3"><br></p>
134 <p class=
"p5"><span class=
"s4">History
</span><span class=
"s5">.drop(-
1);
</span>// drop the oldest memory
</p>
135 <p class=
"p5"><span class=
"s4">History
</span><span class=
"s5">.drop(
1);
</span>// drop the newest memory
</p>
136 <p class=
"p3"><br></p>
137 <p class=
"p6">h.keep(
9);
<span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>h.lines.printAll;
<span class=
"s8">""</span>;
</p>
138 <p class=
"p6">h.drop(
3);
<span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>h.lines.printAll;
<span class=
"s8">""</span>;
</p>
139 <p class=
"p6">h.removeLast;
<span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>h.lines.printAll;
<span class=
"s8">""</span>;
</p>
140 <p class=
"p6">h.removeAt([
3,
4]);
<span class=
"Apple-tab-span"> </span>h.lines.printAll;
<span class=
"s8">""</span>;
</p>
141 <p class=
"p3"><br></p>
142 <p class=
"p3"><br></p>
143 <p class=
"p5">// more examples
</p>
144 <p class=
"p6"><span class=
"s4">History
</span>.clear.start;
</p>
145 <p class=
"p3"><br></p>
146 <p class=
"p5"><span class=
"s5">1 +
2;
<span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></span>// code lines get stored
</p>
147 <p class=
"p3"><br></p>
148 <p class=
"p5"><span class=
"s5">(
</span><span class=
"s4">nil
</span><span class=
"s5"> +
2).postln;
<span class=
"Apple-tab-span"> </span></span>// error lines
<span class=
"Apple-converted-space"> </span>are ignored
<span class=
"Apple-converted-space"> </span></p>
149 <p class=
"p3"><br></p>
150 <p class=
"p5"><span class=
"s5"><span class=
"Apple-tab-span"> </span></span>// comment-only line is kept, empty lines not:
</p>
151 <p class=
"p3"><br></p>
152 <p class=
"p5"><span class=
"s5"><span class=
"Apple-tab-span"> </span></span>// save and load as text files
</p>
153 <p class=
"p3"><br></p>
154 <p class=
"p3"><br></p>
155 <p class=
"p5"><span class=
"s4">History
</span><span class=
"s5">.saveCS;
</span>// save as compilestring for reloading.
</p>
156 <p class=
"p5"><span class=
"s5"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></span>// save with name, in forward time order.
</p>
157 <p class=
"p8"><span class=
"s4">History
</span><span class=
"s5">.saveCS(
</span>"~/Desktop/testHist.scd"<span class=
"s5">, forward:
</span><span class=
"s4">true
</span><span class=
"s5">);
</span></p>
158 <p class=
"p5"><span class=
"s5"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></span>// load back in from file
</p>
159 <p class=
"p6">h =
<span class=
"s4">History
</span>.new.loadCS(
<span class=
"s8">"~/Desktop/testHist.scd"</span>, forward:
<span class=
"s4">true
</span>);
</p>
160 <p class=
"p6">h.lines.postcs;
<span class=
"s8">""</span>;
</p>
161 <p class=
"p3"><br></p>
162 <p class=
"p5"><span class=
"s5"><span class=
"Apple-tab-span"> </span></span>// save as human-readable/hand-playable story
<span class=
"Apple-converted-space"> </span></p>
163 <p class=
"p5"><span class=
"s4">History
</span><span class=
"s5">.saveStory
<span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></span>// write all to time-stamped file in historical order
</p>
164 <p class=
"p5"><span class=
"s4">History
</span><span class=
"s5">.saveStory(
</span><span class=
"s8">"~/Desktop/myTestStory.scd"</span><span class=
"s5">);
<span class=
"Apple-tab-span"> </span></span>// ... with given filename.
<span class=
"Apple-converted-space"> </span></p>
165 <p class=
"p5"><span class=
"s4">History
</span><span class=
"s5">.loadStory(
</span><span class=
"s8">"~/Desktop/myTestStory.scd"</span><span class=
"s5">);
<span class=
"Apple-tab-span"> </span></span>// load from story format file
<span class=
"Apple-converted-space"> </span></p>
166 <p class=
"p3"><br></p>
167 <p class=
"p5"><span class=
"s4">Document
</span><span class=
"s5">.open(
</span><span class=
"s8">"~/Desktop/myTestStory.scd"</span><span class=
"s5">);
<span class=
"Apple-tab-span"> </span></span>// the story file is human-readable.
</p>
168 <p class=
"p3"><br></p>
169 <p class=
"p3"><br></p>
170 <p class=
"p5"><span class=
"s5"><span class=
"Apple-tab-span"> </span></span>// Various Internals
</p>
171 <p class=
"p5"><span class=
"s5"><span class=
"Apple-tab-span"> </span></span>// make a new instance of History by hand:
</p>
172 <p class=
"p6">h =
<span class=
"s4">History
</span>([[
0,
<span class=
"s7">\me
</span>,
<span class=
"s8">"1+2"</span>], [
1.234,
<span class=
"s7">\me
</span>,
<span class=
"s8">"q = q ? ();"</span>], [
3,
<span class=
"s7">\me
</span>,
<span class=
"s8">"\"History\
".speak"</span>]]);
</p>
173 <p class=
"p6">h.lines.printcsAll;
<span class=
"s8">""</span>;
</p>
174 <p class=
"p6">h.lineShorts.printcsAll;
<span class=
"s8">""</span>;
</p>
175 <p class=
"p3"><br></p>
176 <p class=
"p5"><span class=
"s5">h.play;
<span class=
"Apple-tab-span"> </span></span>// play it
</p>
177 <p class=
"p6">h.stop;
</p>
178 <p class=
"p3"><br></p>
179 <p class=
"p3"><br></p>
180 <p class=
"p5"><span class=
"s5"><span class=
"Apple-tab-span"> </span></span>// string formatting utils
</p>
181 <p class=
"p6">h.storyString;
</p>
182 <p class=
"p6"><span class=
"s4">History
</span>.formatTime(
1234.56);
</p>
183 <p class=
"p6"><span class=
"s4">History
</span>.unformatTime(
<span class=
"s8">"0:20:34.56"</span>);
</p>
185 <p class=
"p6"><span class=
"s4">History
</span>.prettyString(
<span class=
"s8">"</span></p>
186 <p class="p8
">/* removes line returns at start and end of code strings ... */</p>
187 <p class="p9
"><br></p>
188 <p class="p6
"><span class="s8
">"</span>).postcs;
</p>
189 <p class=
"p5"><span class=
"s5">)
<span class=
"Apple-tab-span"> </span></span>// convert a line to a short string of n characters for gui display
</p>
190 <p class=
"p6"><span class=
"s4">History
</span>.shorten(h.lines.first.postcs,
60).postcs;
</p>
191 <p class=
"p3"><br></p>
192 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
193 <p class=
"p5"><span class=
"s5"><span class=
"Apple-tab-span"> </span></span>// in networked setups, one may turn off local recording and rely on remote recording:
</p>
194 <p class=
"p6"><span class=
"s4">History
</span>.recordLocally
</p>
195 <p class=
"p6"><span class=
"s4">History
</span>.localOff
</p>
196 <p class=
"p6"><span class=
"s4">History
</span>.recordLocally
</p>
197 <p class=
"p6"><span class=
"s4">History
</span>.localOn
</p>
198 <p class=
"p6"><span class=
"s4">History
</span>.recordLocally
</p>
199 <p class=
"p3"><br></p>
200 <p class=
"p3"><br></p>
201 <p class=
"p5"><span class=
"s5"><span class=
"Apple-tab-span"> </span></span>// by default, history always logs here (and makes the folder if not there yet):
</p>
202 <p class=
"p6"><span class=
"s4">History
</span>.logFolder;
</p>
203 <p class=
"p6"><span class=
"s4">History
</span>.showLogFolder;
</p>
204 <p class=
"p6"><span class=
"s4">History
</span>.logPath;
</p>
205 <p class=
"p5"><span class=
"s4">History
</span><span class=
"s5">.showLogFile;
<span class=
"Apple-converted-space"> </span></span>// current logfile...
</p>
206 <p class=
"p5"><span class=
"s5"><span class=
"Apple-tab-span"> </span></span>// todo: optionally, one should be able to turn logging off?
</p>
207 <p class=
"p3"><br></p>
208 <p class=
"p5"><span class=
"s5"><span class=
"Apple-tab-span"> </span></span>// filtering lines, to get subsets of all lines by key and/or searchstring:
<span class=
"Apple-converted-space"> </span></p>
209 <p class=
"p3"><br></p>
210 <p class=
"p5"><span class=
"s5"><span class=
"Apple-tab-span"> </span></span>// get indices for specific keys
</p>
211 <p class=
"p8"><span class=
"s5">h =
</span><span class=
"s4">History
</span><span class=
"s5">([[
0,
</span><span class=
"s7">\me
</span><span class=
"s5">,
</span>"a=1+2"<span class=
"s5">], [
1,
</span><span class=
"s7">\me
</span><span class=
"s5">,
</span>"3+5"<span class=
"s5">], [
1.234,
</span><span class=
"s7">\you
</span><span class=
"s5">,
</span>"q = q ? ();"<span class=
"s5">], [
3,
</span><span class=
"s7">\her
</span><span class=
"s5">,
</span>"\"Herstory ==== \
".speak"<span class=
"s5">]]);
</span></p>
212 <p class=
"p6">h.keys;
</p>
213 <p class=
"p6">h.matchKeys(
<span class=
"s7">\me
</span>);
</p>
214 <p class=
"p6">h.matchKeys(
<span class=
"s7">\you
</span>);
</p>
215 <p class=
"p6">h.matchKeys(
<span class=
"s7">\her
</span>);
</p>
216 <p class=
"p5"><span class=
"s5">h.matchKeys;
<span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></span>// nil if no test
</p>
217 <p class=
"p5"><span class=
"s5">h.matchKeys(
</span><span class=
"s7">\all
</span><span class=
"s5">);
<span class=
"Apple-tab-span"> </span></span>// all keys match
</p>
218 <p class=
"p6">h.matchKeys([
<span class=
"s7">\me
</span>,
<span class=
"s7">\her
</span>])
</p>
219 <p class=
"p5"><span class=
"s5">h.matchKeys(
</span><span class=
"s7">\isidor
</span><span class=
"s5">)
<span class=
"Apple-tab-span"> </span></span>// empty array if no line found
</p>
220 <p class=
"p3"><br></p>
221 <p class=
"p6">h.matchString(
<span class=
"s8">"Herst"</span>);
<span class=
"Apple-converted-space"> </span></p>
222 <p class=
"p6">h.matchString(
<span class=
"s8">"q"</span>);
<span class=
"Apple-converted-space"> </span></p>
223 <p class=
"p6">h.matchString(
<span class=
"s8">"1+"</span>);
<span class=
"Apple-converted-space"> </span></p>
224 <p class=
"p5"><span class=
"s5">h.matchString(
</span><span class=
"s8">"herStory"</span><span class=
"s5">,
</span><span class=
"s4">false
</span><span class=
"s5">);
</span>// ignoreCase is false by default
</p>
225 <p class=
"p6">h.matchString(
<span class=
"s8">"herStory"</span>,
<span class=
"s4">true
</span>);
<span class=
"s6">// ignoreCase
<span class=
"Apple-converted-space"> </span></span></p>
226 <p class=
"p3"><br></p>
227 <p class=
"p5"><span class=
"s5">h.indicesFor([
</span><span class=
"s7">\me
</span><span class=
"s5">,
</span><span class=
"s7">\her
</span><span class=
"s5">],
</span><span class=
"s8">"="</span><span class=
"s5">);
<span class=
"Apple-converted-space"> </span></span>// indices for line written by \me or \her AND containing
"=";
</p>
228 <p class=
"p3"><br></p>
229 <p class=
"p5"><span class=
"s5"><span class=
"Apple-tab-span"> </span></span>// searching is only an interface/access feature,
<span class=
"Apple-converted-space"> </span></p>
230 <p class=
"p5"><span class=
"s5"><span class=
"Apple-tab-span"> </span></span>// so please read on at
<a href=
"HistoryGui.htm"><span class=
"s4">HistoryGui
</span></a> help ...
<span class=
"Apple-converted-space"> </span></p>
231 <p class=
"p6">h.makeWin;
</p>
232 <p class=
"p4"><br></p>
233 <p class=
"p10"><span class=
"s9">HistoryGui
</span>.openHelpFile;
</p>
234 <p class=
"p11"><br></p>