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 Beyond The Titanic. Beyond The Titanic is free }
\r
28 {software; you can redistribute it and/or modify it under the terms of the }
\r
29 {GNU General Public License as published by the Free Software Foundation; }
\r
30 {either version 3 of the License, or (at your option) any later version. }
\r
32 {This program is distributed in the hope that it will be useful, but WITHOUT}
\r
33 {ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or }
\r
34 {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, 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
50 Special_Responce_Writer;
\r
52 {This program WRITES and READS from the two text files:
\r
53 'special1' and 'special2'. If a description exceeds 240 letters (Max),
\r
54 then the file 'special2' is used. Otherwise 'special2' = ''.}
\r
55 {This program has the line edit feature!}
\r
63 DescriptionLength = string[Max];
\r
64 OneChar = string[1];
\r
67 Special1, Special2 : file of descriptionlength;
\r
68 Position,Counter,Start,Stop : integer;
\r
69 Text1, Text2 : descriptionlength;
\r
74 procedure Diskwrite(text1,text2: Descriptionlength; pointer: integer);
\r
76 seek(special1,pointer); seek(special2,pointer);
\r
77 WRITE(special1,text1); WRITE(special2,text2);
\r
78 writeln('Special responce ',pointer,
\r
79 ' is written! Size = ',filesize(special1));
\r
80 close(special1); close(special2);
\r
81 end; {End of Diskwrite.}
\r
83 procedure Diskread(start,stop: integer);
\r
86 text1, text2 : descriptionlength;
\r
88 assign(special1,'special1'); assign(special2,'special2');
\r
89 reset(special1); reset(special2);
\r
90 seek(special1,start); seek(special2,start);
\r
91 for counter:= start to stop do
\r
94 READ(special1,text1); READ(special2,text2);
\r
97 writeln(lst,'Special # ',counter);
\r
98 writeln(lst,text1,text2);
\r
102 writeln('Here is special responce # ',counter);
\r
104 writeln(text1,text2);
\r
109 write('The file contains ',filesize(special1),' special responces.');
\r
110 close(special1); close(special2);
\r
111 end; {End of Diskread.}
\r
115 if(length(text1)in[70,150,230])or(length(text2)in[70,150,230])then write(^g);
\r
119 repeat {Main loop.}
\r
124 writeln('Do you want to R)ead or W)rite?');
\r
126 if upcase(answer) <> 'R' then {Write to 'Special' files.}
\r
129 assign(special1,'special1'); assign(special2,'special2');
\r
130 writeln('Now RESETing Special files.');
\r
131 RESET(special1); RESET(special2);
\r
133 writeln('Input a string not more than ',2*Max,' characters.',
\r
134 ' ''\''-Ends string.');
\r
139 if letter = ^h then
\r
142 delete(text1,length(text1),1);
\r
145 if (letter <> '\') and (letter <> ^h) then text1:=text1+letter
\r
146 until (length(text1)=Max) or (letter='\');
\r
148 if letter = '\' then
\r
151 writeln('Total of ',length(text1),' characters.');
\r
158 writeln('String #1 is full! Now writing to string #2.',^g);
\r
163 if letter = ^h then
\r
166 delete(text2,length(text2),1);
\r
169 if (letter <> '\') and (letter <> ^h) then text2:=text2+letter
\r
170 until (length(text2)=Max) or (letter='\');
\r
171 writeln; highvideo;
\r
172 writeln('Total description length = ',
\r
173 length(text1)+length(text2),' characters.');
\r
175 writeln('Now WRITING string to disk.');
\r
176 writeln(' At what position? (Next open is # ',filesize(special1),')');
\r
178 Diskwrite(text1,text2,position);
\r
180 else {Read from 'Rooms'.}
\r
183 writeln('To the S)creen or the P)rinter?');
\r
185 if(upcase(answer)='P')then List:=True else List:=False;
\r
186 assign(special1,'special1');
\r
188 writeln('Filesize = ',filesize(special1),
\r
189 ' (From 0 to ',filesize(special1)-1,')');
\r
191 writeln('Enter starting position:');
\r
193 if(start > filesize(special1)-5)then stop:=(filesize(special1)-1) else
\r
195 writeln('Enter final position:');
\r
198 Diskread(start,stop);
\r
200 end; {End of else clause.}
\r
201 writeln;writeln('Another special responce? Y)es or N)o');
\r
203 until upcase(answer) = 'N'; {End of Main loop.}
\r
204 writeln; writeln(^g,'You are now out of the program.')
\r