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