1 {//-------------------------------------------------------------------------}
\r
3 {Copyright (C) 1990, 2009 - Apogee Software, Ltd. }
\r
5 {This file is part of Supernova. Supernova is free software; you can }
\r
6 {redistribute it and/or modify it under the terms of the GNU General Public }
\r
7 {License as published by the Free Software Foundation; either version 3 }
\r
8 {of the License, or (at your option) any later version. }
\r
10 {This program is distributed in the hope that it will be useful, }
\r
11 {but WITHOUT ANY WARRANTY; without even the implied warranty of }
\r
12 {MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. }
\r
14 {See the GNU General Public License for more details. }
\r
16 {You should have received a copy of the GNU General Public License }
\r
17 {along with this program; if not, write to the Free Software }
\r
18 {Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.}
\r
20 {Original Source: 1990 Scott Miller }
\r
21 {Prepared for public release: 03/19/09 - Joe Siegler, Apogee Software, Ltd. }
\r
23 {//-------------------------------------------------------------------------}
\r
25 Special_Responce_Writer;
\r
27 {This program WRITES and READS from the two text files:
\r
28 'special1' and 'special2'. If a description exceeds 240 letters (Max),
\r
29 then the file 'special2' is used. Otherwise 'special2' = ''.}
\r
30 {This program has the line edit feature!}
\r
35 DescriptionLength = string[Max];
\r
36 OneChar = string[1];
\r
39 Special1, Special2 : file of descriptionlength;
\r
40 Position,Counter,Start,Stop : integer;
\r
41 Text1, Text2 : descriptionlength;
\r
46 procedure Diskwrite(text1,text2: Descriptionlength; pointer: integer);
\r
48 seek(special1,pointer); seek(special2,pointer);
\r
49 WRITE(special1,text1); WRITE(special2,text2);
\r
50 writeln('Special responce ',pointer,
\r
51 ' is written! Size = ',filesize(special1));
\r
52 close(special1); close(special2);
\r
53 end; {End of Diskwrite.}
\r
55 procedure Diskread(start,stop: integer);
\r
58 text1, text2 : descriptionlength;
\r
60 assign(special1,'special1'); assign(special2,'special2');
\r
61 reset(special1); reset(special2);
\r
62 seek(special1,start); seek(special2,start);
\r
63 for counter:= start to stop do
\r
66 READ(special1,text1); READ(special2,text2);
\r
69 writeln(lst,'Special # ',counter);
\r
70 writeln(lst,text1,text2);
\r
74 writeln('Here is special responce # ',counter);
\r
76 writeln(text1,text2);
\r
80 close(special1); close(special2);
\r
81 write('The file contains ',filesize(special1),' special responces.');
\r
82 end; {End of Diskread.}
\r
86 if(length(text1)in[70,150,230])or(length(text2)in[70,150,230])then write(^g);
\r
95 writeln('Do you want to R)ead or W)rite?');
\r
97 if upcase(answer) <> 'R' then {Write to 'Special' files.}
\r
100 assign(special1,'special1'); assign(special2,'special2');
\r
101 writeln('Now RESETing Special files.');
\r
102 RESET(special1); RESET(special2);
\r
104 writeln('Input a string not more than ',2*Max,' characters.',
\r
105 ' ''\''-Ends string.');
\r
109 if letter = ^h then
\r
112 delete(text1,length(text1),2);
\r
115 if (letter <> '\') and (letter <> ^h) then text1:=text1+letter
\r
116 until (length(text1)=Max) or (letter='\');
\r
118 if letter = '\' then
\r
121 writeln('Total of ',length(text1),' characters.');
\r
128 writeln('String #1 is full! Now writing to string #2.',^g);
\r
132 if letter = ^h then
\r
135 delete(text2,length(text2),2);
\r
138 if (letter <> '\') and (letter <> ^h) then text2:=text2+letter
\r
139 until (length(text2)=Max) or (letter='\');
\r
140 writeln; highvideo;
\r
141 writeln('Total description length = ',
\r
142 length(text1)+length(text2),' characters.');
\r
144 writeln('Now WRITING string to disk.');
\r
145 writeln(' At what position? (Next open is # ',filesize(special1),')');
\r
147 Diskwrite(text1,text2,position);
\r
149 else {Read from 'Rooms'.}
\r
152 writeln('To the S)creen or the P)rinter?');
\r
154 if(upcase(answer)='P')then List:=True else List:=False;
\r
155 assign(special1,'special1');
\r
157 writeln('Filesize = ',filesize(special1),
\r
158 ' (From 0 to ',filesize(special1)-1,')');
\r
160 writeln('Enter starting position:');
\r
162 if(start > filesize(special1)-5)then stop:=(filesize(special1)-1) else
\r
164 writeln('Enter final position:');
\r
167 Diskread(start,stop);
\r
168 end; {End of else clause.}
\r
169 writeln;writeln('Another special responce? Y)es or N)o');
\r
171 until upcase(answer) = 'N'; {End of Main loop.}
\r
172 writeln; writeln(^g,'You are now out of the program.')
\r