Fixed resource file editors.
authorJason Self <j@jxself.org>
Sat, 31 May 2014 21:20:49 +0000 (14:20 -0700)
committerJason Self <j@jxself.org>
Sat, 31 May 2014 21:20:49 +0000 (14:20 -0700)
src/ROOMRITE.PAS
src/SPECIAL.PAS

index ebf64b75b79f6099e4b0c88112371c8f28192abc..df0097049505b1f16ec88616e26e63183a5b5fa8 100644 (file)
@@ -1,5 +1,38 @@
 {//-------------------------------------------------------------------------}\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 Beyond The Titanic. Beyond The Titanic is free        }\r
+{software; you can redistribute it and/or modify it under the terms of the  }\r
+{GNU General Public License as published by the Free Software Foundation;   }\r
+{either version 3 of the License, or (at your option) any later version.    }\r
+{                                                                           }\r
+{This program 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.                                          }\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 +61,9 @@ program
      'rooms2'.  If a description exceeds 240 letters (Max), then the file\r
                'rooms2' is used.  Otherwise 'rooms2' = ''.}\r
                  {This program has the line edit feature!}\r
+\r
+uses Crt, Printer;\r
+\r
 const\r
   Max = 240;\r
 \r
@@ -47,7 +83,7 @@ procedure Diskwrite(text1,text2: Descriptionlength; pointer: integer);
   begin\r
     seek(rooms1,pointer); seek(rooms2,pointer);\r
     WRITE(rooms1,text1); WRITE(rooms2,text2);\r
-    writeln('Room decription ',pointer,\r
+    writeln('Room description ',pointer,\r
             ' is written!  Size = ',filesize(rooms1));\r
     close(rooms1); close(rooms2);\r
   end; {End of Diskwrite.}\r
@@ -57,16 +93,19 @@ var
 counter : integer;\r
 text1, text2 : descriptionlength;\r
   begin\r
-   assign(rooms1,'rooms1');assign(rooms2,'rooms2');\r
-   reset(rooms1); reset(rooms2);\r
-   seek(rooms1,start); seek(rooms2,start);\r
+   assign(rooms1,'ROOMS1');\r
+   assign(rooms2,'ROOMS2');\r
+   reset(rooms1);\r
+   reset(rooms2);\r
+   seek(rooms1,start);\r
+   seek(rooms2,start);\r
     for counter:= start to stop do\r
       begin\r
         highvideo;\r
         READ(rooms1,text1); READ(rooms2,text2);\r
         if list then\r
           begin\r
-            writeln(lst,'Discription # ',counter);\r
+            writeln(lst,'Description # ',counter);\r
             writeln(lst,text1,text2);\r
           end\r
         else\r
@@ -77,8 +116,8 @@ text1, text2 : descriptionlength;
             highvideo;\r
           end;\r
       end;\r
+    write('The file contains ',FileSize(rooms1),' room descriptions.');\r
     close(rooms1); close(rooms2);\r
-    write('The file contains ',filesize(rooms1),' room descriptions.');\r
   end;  {End of Diskread.}\r
 \r
 procedure Beep;\r
@@ -93,11 +132,11 @@ 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 'Rooms'.}\r
     begin\r
       writeln;writeln;\r
-      assign(rooms1,'rooms1'); assign(rooms2,'rooms2');\r
+      assign(rooms1,'ROOMS1'); assign(rooms2,'ROOMS2');\r
       writeln('Now RESETing room files.');\r
             RESET(rooms1); RESET(rooms2);\r
       writeln;\r
@@ -105,14 +144,16 @@ if upcase(answer) <> 'R' then       {Write to 'Rooms'.}
               '  ''\''-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
+\r
             end;\r
           beep;\r
-          if (letter <> '\') and (letter <> ^h) then text1:=text1+letter\r
+          if (letter <> '\') and (letter <> ^h) then text1:=text1+letter;\r
         until (length(text1)=Max) or (letter='\');\r
         writeln;\r
         if letter = '\' then\r
@@ -128,11 +169,12 @@ if upcase(answer) <> 'R' then       {Write to 'Rooms'.}
             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,15 +192,18 @@ 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(rooms1,'rooms1');\r
+    assign(rooms1,'ROOMS1');\r
     reset(rooms1);\r
     writeln('Filesize = ',filesize(rooms1),\r
             '  (From 0 to ',filesize(rooms1)-1,')');\r
-    close(rooms1);\r
+    // close(rooms1);\r
     writeln('Enter starting position:');\r
     readln(start);\r
+    writeln('Evo filesize rooms1: ');\r
+    writeln(filesize(rooms1));\r
+\r
     if(start > filesize(rooms1)-5)then stop:=(filesize(rooms1)-1) else\r
       begin\r
         writeln('Enter final position:');\r
@@ -166,11 +211,9 @@ else                      {Read from 'Rooms'.}
       end;\r
     Diskread(start,stop);\r
   end;  {End of else clause.}\r
-writeln;writeln('Another room description?  Y)es or N)o');\r
-read(kbd,answer);\r
+writeln;\r
+writeln('Another room description?  Y)es or N)o');\r
+read(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
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