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, write to the Free Software }
\r
40 {Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.}
\r
42 {Original Source: 1990 Scott Miller }
\r
43 {Prepared for public release: 03/19/09 - Joe Siegler, Apogee Software, Ltd. }
\r
45 {//-------------------------------------------------------------------------}
\r
47 Special_Responce_Writer;
\r
49 {This program WRITES and READS from the two text files:
\r
50 'special1' and 'special2'. If a description exceeds 240 letters (Max),
\r
51 then the file 'special2' is used. Otherwise 'special2' = ''.}
\r
52 {This program has the line edit feature!}
\r
60 DescriptionLength = string[Max];
\r
61 OneChar = string[1];
\r
64 Special1, Special2 : file of descriptionlength;
\r
65 Position,Counter,Start,Stop : integer;
\r
66 Text1, Text2 : descriptionlength;
\r
71 procedure Diskwrite(text1,text2: Descriptionlength; pointer: integer);
\r
73 seek(special1,pointer); seek(special2,pointer);
\r
74 WRITE(special1,text1); WRITE(special2,text2);
\r
75 writeln('Special responce ',pointer,
\r
76 ' is written! Size = ',filesize(special1));
\r
77 close(special1); close(special2);
\r
78 end; {End of Diskwrite.}
\r
80 procedure Diskread(start,stop: integer);
\r
83 text1, text2 : descriptionlength;
\r
85 assign(special1,'special1'); assign(special2,'special2');
\r
86 reset(special1); reset(special2);
\r
87 seek(special1,start); seek(special2,start);
\r
88 for counter:= start to stop do
\r
91 READ(special1,text1); READ(special2,text2);
\r
94 writeln(lst,'Special # ',counter);
\r
95 writeln(lst,text1,text2);
\r
99 writeln('Here is special responce # ',counter);
\r
101 writeln(text1,text2);
\r
106 write('The file contains ',filesize(special1),' special responces.');
\r
107 close(special1); close(special2);
\r
108 end; {End of Diskread.}
\r
112 if(length(text1)in[70,150,230])or(length(text2)in[70,150,230])then write(^g);
\r
116 repeat {Main loop.}
\r
121 writeln('Do you want to R)ead or W)rite?');
\r
123 if upcase(answer) <> 'R' then {Write to 'Special' files.}
\r
126 assign(special1,'special1'); assign(special2,'special2');
\r
127 writeln('Now RESETing Special files.');
\r
128 RESET(special1); RESET(special2);
\r
130 writeln('Input a string not more than ',2*Max,' characters.',
\r
131 ' ''\''-Ends string.');
\r
136 if letter = ^h then
\r
139 delete(text1,length(text1),1);
\r
142 if (letter <> '\') and (letter <> ^h) then text1:=text1+letter
\r
143 until (length(text1)=Max) or (letter='\');
\r
145 if letter = '\' then
\r
148 writeln('Total of ',length(text1),' characters.');
\r
155 writeln('String #1 is full! Now writing to string #2.',^g);
\r
160 if letter = ^h then
\r
163 delete(text2,length(text2),1);
\r
166 if (letter <> '\') and (letter <> ^h) then text2:=text2+letter
\r
167 until (length(text2)=Max) or (letter='\');
\r
168 writeln; highvideo;
\r
169 writeln('Total description length = ',
\r
170 length(text1)+length(text2),' characters.');
\r
172 writeln('Now WRITING string to disk.');
\r
173 writeln(' At what position? (Next open is # ',filesize(special1),')');
\r
175 Diskwrite(text1,text2,position);
\r
177 else {Read from 'Rooms'.}
\r
180 writeln('To the S)creen or the P)rinter?');
\r
182 if(upcase(answer)='P')then List:=True else List:=False;
\r
183 assign(special1,'special1');
\r
185 writeln('Filesize = ',filesize(special1),
\r
186 ' (From 0 to ',filesize(special1)-1,')');
\r
188 writeln('Enter starting position:');
\r
190 if(start > filesize(special1)-5)then stop:=(filesize(special1)-1) else
\r
192 writeln('Enter final position:');
\r
195 Diskread(start,stop);
\r
197 end; {End of else clause.}
\r
198 writeln;writeln('Another special responce? Y)es or N)o');
\r
200 until upcase(answer) = 'N'; {End of Main loop.}
\r
201 writeln; writeln(^g,'You are now out of the program.')
\r