Fixed resource file editors.
[beyond-the-titanic.git] / src / SPECIAL.PAS
index 4c8b34dd58a78a7d9f9de794cfa90da7b13aa701..3ac40664d4da35d63fc4e9e18715436432b217ab 100644 (file)
@@ -1,5 +1,27 @@
 {//-------------------------------------------------------------------------}\r
 {/*                                                                         }\r
+{Copyright (C) 2014 Jason Self <j@jxself.org>                               }\r
+{                                                                           }\r
+{This file is free software: you may copy, redistribute and/or modify it    }\r
+{under the terms of the GNU Affero General Public License as published by   }\r
+{the Free Software Foundation, either version 3 of the License, or (at your }\r
+{option) any later version.                                                 }\r
+{                                                                           }\r
+{This file is distributed in the hope that it will be useful, but WITHOUT   }\r
+{ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or      }\r
+{FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License}\r
+{for more details.                                                          }\r
+{                                                                           }\r
+{You should have received a copy of the GNU Affero General Public License   }\r
+{along with this program; if not, see https://gnu.org/licenses or write to: }\r
+{  Free Software Foundation, Inc.                                           }\r
+{  51 Franklin Street, Fifth Floor                                          }\r
+{  Boston, MA 02110-1301                                                    }\r
+{  USA                                                                      }\r
+{                                                                           }\r
+{This file incorporates work covered by the following copyright and         }\r
+{permission notice:                                                         }\r
+{                                                                           }\r
 {Copyright (C) 1990, 2009 - Apogee Software, Ltd.                           }\r
 {                                                                           }\r
 {This file is part of Supernova.  Supernova is free software; you can       }\r
@@ -28,6 +50,9 @@ program
     'special1' and 'special2'.  If a description exceeds 240 letters (Max),\r
        then the file 'special2' is used.  Otherwise 'special2' = ''.}\r
                {This program has the line edit feature!}\r
+\r
+uses Crt, Printer;\r
+\r
 const\r
   Max = 240;\r
 \r
@@ -77,8 +102,9 @@ text1, text2 : descriptionlength;
             highvideo;\r
           end;\r
       end;\r
-    close(special1); close(special2);\r
+\r
     write('The file contains ',filesize(special1),' special responces.');\r
+    close(special1); close(special2);\r
   end;  {End of Diskread.}\r
 \r
 procedure Beep;\r
@@ -93,7 +119,7 @@ repeat          {Main loop.}
 \r
 writeln;\r
 writeln('Do you want to R)ead or W)rite?');\r
-read(kbd,answer);\r
+readln(answer);\r
 if upcase(answer) <> 'R' then       {Write to 'Special' files.}\r
     begin\r
       writeln;writeln;\r
@@ -105,11 +131,12 @@ if upcase(answer) <> 'R' then       {Write to 'Special' files.}
               '  ''\''-Ends string.');\r
       lowvideo;\r
         repeat\r
-          read(trm,letter);\r
+          letter := ReadKey;\r
+          write(letter);\r
           if letter = ^h then\r
             begin\r
-              write(^h,' ',^h);\r
-              delete(text1,length(text1),2);\r
+              write(' ',^h);\r
+              delete(text1,length(text1),1);\r
             end;\r
           beep;\r
           if (letter <> '\') and (letter <> ^h) then text1:=text1+letter\r
@@ -128,11 +155,12 @@ if upcase(answer) <> 'R' then       {Write to 'Special' files.}
             writeln('String #1 is full!  Now writing to string #2.',^g);\r
             lowvideo;\r
               repeat\r
-                read(trm,letter);\r
+                letter := ReadKey;\r
+                write(letter);\r
                 if letter = ^h then\r
                   begin\r
-                    write(^h,' ',^h);\r
-                    delete(text2,length(text2),2);\r
+                    write(' ',^h);\r
+                    delete(text2,length(text2),1);\r
                   end;\r
                 beep;\r
                 if (letter <> '\') and (letter <> ^h) then text2:=text2+letter\r
@@ -150,13 +178,13 @@ else                      {Read from 'Rooms'.}
   begin\r
     writeln;writeln;\r
     writeln('To the S)creen or the P)rinter?');\r
-    read(kbd,answer);\r
+    readln(answer);\r
     if(upcase(answer)='P')then List:=True else List:=False;\r
     assign(special1,'special1');\r
     reset(special1);\r
     writeln('Filesize = ',filesize(special1),\r
             '  (From 0 to ',filesize(special1)-1,')');\r
-    close(special1);\r
+\r
     writeln('Enter starting position:');\r
     readln(start);\r
     if(start > filesize(special1)-5)then stop:=(filesize(special1)-1) else\r
@@ -165,12 +193,10 @@ else                      {Read from 'Rooms'.}
         readln(stop);\r
       end;\r
     Diskread(start,stop);\r
+\r
   end;  {End of else clause.}\r
 writeln;writeln('Another special responce?  Y)es or N)o');\r
-read(kbd,answer);\r
+readln(answer);\r
 until upcase(answer) = 'N';     {End of Main loop.}\r
 writeln; writeln(^g,'You are now out of the program.')\r
 END.\r
-\r
-\r
-\1a\r