1 {//-------------------------------------------------------------------------}
\r
3 {Copyright (C) 2014 Jason Self <j@jxself.org> }
\r
5 {This file is free software: you may copy, redistribute and/or modify it }
\r
6 {under the terms of the GNU Affero General Public License as published by }
\r
7 {the Free Software Foundation, either version 3 of the License, or (at your }
\r
8 {option) any later version. }
\r
10 {This file is distributed in the hope that it will be useful, but WITHOUT }
\r
11 {ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or }
\r
12 {FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License}
\r
13 {for more details. }
\r
15 {You should have received a copy of the GNU Affero General Public License }
\r
16 {along with this program; if not, see https://gnu.org/licenses or write to: }
\r
17 { Free Software Foundation, Inc. }
\r
18 { 51 Franklin Street, Fifth Floor }
\r
19 { Boston, MA 02110-1301 }
\r
22 {This file incorporates work covered by the following copyright and }
\r
23 {permission notice: }
\r
25 {Copyright (C) 1990, 2009 - Apogee Software, Ltd. }
\r
27 {This file is part of Supernova. Supernova is free software; you can }
\r
28 {redistribute it and/or modify it under the terms of the GNU General Public }
\r
29 {License as published by the Free Software Foundation; either version 3 }
\r
30 {of the License, or (at your option) any later version. }
\r
32 {This program is distributed in the hope that it will be useful, }
\r
33 {but WITHOUT ANY WARRANTY; without even the implied warranty of }
\r
34 {MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. }
\r
36 {See the GNU General Public License for more details. }
\r
38 {You should have received a copy of the GNU General Public License }
\r
39 {along with this program; if not, see https://gnu.org/licenses or write to: }
\r
40 { Free Software Foundation, Inc. }
\r
41 { 51 Franklin Street, Fifth Floor }
\r
42 { Boston, MA 02110-1301 }
\r
45 {Original Source: 1990 Scott Miller }
\r
46 {Prepared for public release: 03/19/09 - Joe Siegler, Apogee Software, Ltd. }
\r
48 {//-------------------------------------------------------------------------}
\r
56 MaxLength = string[Max];
\r
57 OneChar = string[1];
\r
60 C1 : file of MaxLength;
\r
62 Start,Stop,x : integer;
\r
68 procedure Diskwrite(text1: MaxLength; pointer: integer);
\r
72 writeln('Clue ',pointer,
\r
73 ' is written! Size = ',filesize(C1));
\r
75 end; {End of Diskwrite.}
\r
77 procedure Diskread(start,stop: integer);
\r
85 for counter:= start to stop do
\r
89 if list then writeln(counter,':',text1)
\r
92 writeln('Here is CLUE # ',counter);
\r
99 write('The file contains ',filesize(C1),' CLUES.');
\r
100 end; {End of Diskread.}
\r
104 if(length(text1)=68)then
\r
105 begin sound(99);delay(50);nosound;end;
\r
111 repeat {Main loop.}
\r
115 writeln('Do you want to R)ead, W)rite or Q)uit?');
\r
117 if upcase(answer) = 'Q' then begin writeln('FINISHED');halt;end;
\r
118 if upcase(answer) <> 'R' then {Write to 'Clues'.}
\r
122 textcolor(9);writeln('Now RESETing CLUE files.');highvideo;
\r
125 writeln('Input a string not more than ',Max,' characters.',
\r
126 ' ''\''-Ends string.');
\r
127 x:=wherey;if(x>21)then x:=22;for stop:=1 to 3 do writeln;gotoxy(1,x);
\r
131 if letter = ^h then
\r
134 delete(text1,length(text1),2);
\r
137 if (letter <> '\') and (letter <> ^h) then text1:=text1+letter
\r
138 until (length(text1)=Max) or (letter='\');
\r
139 if letter = '\' then
\r
143 writeln('Total of ',length(text1),' characters.');
\r
145 writeln; highvideo;
\r
146 writeln('Total description length = ',length(text1),' characters.');
\r
147 writeln('Now WRITING string to disk.');
\r
148 writeln(' At what position? (Next open is # ',filesize(C1),')');
\r
149 textcolor(12);position:=position+1;readln(position);highvideo;
\r
150 Diskwrite(text1,position);
\r
152 else {Read from 'Clues'.}
\r
155 writeln('To the S)creen or the P)rinter');
\r
157 if(upcase(answer)='P')then List:=True else List:=False;
\r
160 writeln('Filesize = ',filesize(C1),
\r
161 ' (From 0 to ',filesize(C1)-1,')');
\r
163 writeln('Enter starting position:');
\r
164 textcolor(12);readln(start);highvideo;
\r
165 if(start > filesize(C1)-5)then stop:=(filesize(C1)-1) else
\r
167 writeln('Enter final position:');
\r
168 textcolor(12);readln(stop);highvideo;
\r
170 Diskread(start,stop);
\r
171 end; {End of else clause.}
\r
172 until false; {End of Main loop.}
\r