From 07cd06e180ceaae5f896479b715af93a22c53b3f Mon Sep 17 00:00:00 2001 From: Jason Self Date: Sat, 31 May 2014 14:20:49 -0700 Subject: [PATCH] Fixed resource file editors. --- src/ROOMRITE.PAS | 89 +++++++++++++++++++++++++++++++++++------------- src/SPECIAL.PAS | 54 +++++++++++++++++++++-------- 2 files changed, 106 insertions(+), 37 deletions(-) diff --git a/src/ROOMRITE.PAS b/src/ROOMRITE.PAS index ebf64b7..df00970 100644 --- a/src/ROOMRITE.PAS +++ b/src/ROOMRITE.PAS @@ -1,5 +1,38 @@ {//-------------------------------------------------------------------------} {/* } +{Copyright (C) 2014 Jason Self } +{ } +{This file is free software: you may copy, redistribute and/or modify it } +{under the terms of the GNU Affero General Public License as published by } +{the Free Software Foundation, either version 3 of the License, or (at your } +{option) any later version. } +{ } +{This file is distributed in the hope that it will be useful, but WITHOUT } +{ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or } +{FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License} +{for more details. } +{ } +{You should have received a copy of the GNU Affero General Public License } +{along with this program; if not, see https://gnu.org/licenses or write to: } +{ Free Software Foundation, Inc. } +{ 51 Franklin Street, Fifth Floor } +{ Boston, MA 02110-1301 } +{ USA } +{ } +{This file incorporates work covered by the following copyright and } +{permission notice: } +{ } +{Copyright (C) 1990, 2009 - Apogee Software, Ltd. } +{ } +{This file is part of Beyond The Titanic. Beyond The Titanic is free } +{software; you can redistribute it and/or modify it under the terms of the } +{GNU General Public License as published by the Free Software Foundation; } +{either version 3 of the License, or (at your option) any later version. } +{ } +{This program is distributed in the hope that it will be useful, but WITHOUT} +{ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or } +{FITNESS FOR A PARTICULAR PURPOSE. } +{ } {Copyright (C) 1990, 2009 - Apogee Software, Ltd. } { } {This file is part of Supernova. Supernova is free software; you can } @@ -28,6 +61,9 @@ program 'rooms2'. If a description exceeds 240 letters (Max), then the file 'rooms2' is used. Otherwise 'rooms2' = ''.} {This program has the line edit feature!} + +uses Crt, Printer; + const Max = 240; @@ -47,7 +83,7 @@ procedure Diskwrite(text1,text2: Descriptionlength; pointer: integer); begin seek(rooms1,pointer); seek(rooms2,pointer); WRITE(rooms1,text1); WRITE(rooms2,text2); - writeln('Room decription ',pointer, + writeln('Room description ',pointer, ' is written! Size = ',filesize(rooms1)); close(rooms1); close(rooms2); end; {End of Diskwrite.} @@ -57,16 +93,19 @@ var counter : integer; text1, text2 : descriptionlength; begin - assign(rooms1,'rooms1');assign(rooms2,'rooms2'); - reset(rooms1); reset(rooms2); - seek(rooms1,start); seek(rooms2,start); + assign(rooms1,'ROOMS1'); + assign(rooms2,'ROOMS2'); + reset(rooms1); + reset(rooms2); + seek(rooms1,start); + seek(rooms2,start); for counter:= start to stop do begin highvideo; READ(rooms1,text1); READ(rooms2,text2); if list then begin - writeln(lst,'Discription # ',counter); + writeln(lst,'Description # ',counter); writeln(lst,text1,text2); end else @@ -77,8 +116,8 @@ text1, text2 : descriptionlength; highvideo; end; end; + write('The file contains ',FileSize(rooms1),' room descriptions.'); close(rooms1); close(rooms2); - write('The file contains ',filesize(rooms1),' room descriptions.'); end; {End of Diskread.} procedure Beep; @@ -93,11 +132,11 @@ repeat {Main loop.} writeln; writeln('Do you want to R)ead or W)rite?'); -read(kbd,answer); +readln(answer); if upcase(answer) <> 'R' then {Write to 'Rooms'.} begin writeln;writeln; - assign(rooms1,'rooms1'); assign(rooms2,'rooms2'); + assign(rooms1,'ROOMS1'); assign(rooms2,'ROOMS2'); writeln('Now RESETing room files.'); RESET(rooms1); RESET(rooms2); writeln; @@ -105,14 +144,16 @@ if upcase(answer) <> 'R' then {Write to 'Rooms'.} ' ''\''-Ends string.'); lowvideo; repeat - read(trm,letter); + letter := ReadKey; + write(letter); if letter = ^h then begin - write(^h,' ',^h); - delete(text1,length(text1),2); + write(' ', ^h); + delete(text1,length(text1),1); + end; beep; - if (letter <> '\') and (letter <> ^h) then text1:=text1+letter + if (letter <> '\') and (letter <> ^h) then text1:=text1+letter; until (length(text1)=Max) or (letter='\'); writeln; if letter = '\' then @@ -128,11 +169,12 @@ if upcase(answer) <> 'R' then {Write to 'Rooms'.} writeln('String #1 is full! Now writing to string #2.',^g); lowvideo; repeat - read(trm,letter); + letter := ReadKey; + write(letter); if letter = ^h then begin - write(^h,' ',^h); - delete(text2,length(text2),2); + write(' ',^h); + delete(text2,length(text2),1); end; beep; if (letter <> '\') and (letter <> ^h) then text2:=text2+letter @@ -150,15 +192,18 @@ else {Read from 'Rooms'.} begin writeln;writeln; writeln('To the S)creen or the P)rinter'); - read(kbd,answer); + readln(answer); if(upcase(answer)='P')then List:=True else List:=False; - assign(rooms1,'rooms1'); + assign(rooms1,'ROOMS1'); reset(rooms1); writeln('Filesize = ',filesize(rooms1), ' (From 0 to ',filesize(rooms1)-1,')'); - close(rooms1); + // close(rooms1); writeln('Enter starting position:'); readln(start); + writeln('Evo filesize rooms1: '); + writeln(filesize(rooms1)); + if(start > filesize(rooms1)-5)then stop:=(filesize(rooms1)-1) else begin writeln('Enter final position:'); @@ -166,11 +211,9 @@ else {Read from 'Rooms'.} end; Diskread(start,stop); end; {End of else clause.} -writeln;writeln('Another room description? Y)es or N)o'); -read(kbd,answer); +writeln; +writeln('Another room description? Y)es or N)o'); +read(answer); until upcase(answer) = 'N'; {End of Main loop.} writeln; writeln(^g,'You are now out of the program.') END. - - - diff --git a/src/SPECIAL.PAS b/src/SPECIAL.PAS index 4c8b34d..3ac4066 100644 --- a/src/SPECIAL.PAS +++ b/src/SPECIAL.PAS @@ -1,5 +1,27 @@ {//-------------------------------------------------------------------------} {/* } +{Copyright (C) 2014 Jason Self } +{ } +{This file is free software: you may copy, redistribute and/or modify it } +{under the terms of the GNU Affero General Public License as published by } +{the Free Software Foundation, either version 3 of the License, or (at your } +{option) any later version. } +{ } +{This file is distributed in the hope that it will be useful, but WITHOUT } +{ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or } +{FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License} +{for more details. } +{ } +{You should have received a copy of the GNU Affero General Public License } +{along with this program; if not, see https://gnu.org/licenses or write to: } +{ Free Software Foundation, Inc. } +{ 51 Franklin Street, Fifth Floor } +{ Boston, MA 02110-1301 } +{ USA } +{ } +{This file incorporates work covered by the following copyright and } +{permission notice: } +{ } {Copyright (C) 1990, 2009 - Apogee Software, Ltd. } { } {This file is part of Supernova. Supernova is free software; you can } @@ -28,6 +50,9 @@ program 'special1' and 'special2'. If a description exceeds 240 letters (Max), then the file 'special2' is used. Otherwise 'special2' = ''.} {This program has the line edit feature!} + +uses Crt, Printer; + const Max = 240; @@ -77,8 +102,9 @@ text1, text2 : descriptionlength; highvideo; end; end; - close(special1); close(special2); + write('The file contains ',filesize(special1),' special responces.'); + close(special1); close(special2); end; {End of Diskread.} procedure Beep; @@ -93,7 +119,7 @@ repeat {Main loop.} writeln; writeln('Do you want to R)ead or W)rite?'); -read(kbd,answer); +readln(answer); if upcase(answer) <> 'R' then {Write to 'Special' files.} begin writeln;writeln; @@ -105,11 +131,12 @@ if upcase(answer) <> 'R' then {Write to 'Special' files.} ' ''\''-Ends string.'); lowvideo; repeat - read(trm,letter); + letter := ReadKey; + write(letter); if letter = ^h then begin - write(^h,' ',^h); - delete(text1,length(text1),2); + write(' ',^h); + delete(text1,length(text1),1); end; beep; if (letter <> '\') and (letter <> ^h) then text1:=text1+letter @@ -128,11 +155,12 @@ if upcase(answer) <> 'R' then {Write to 'Special' files.} writeln('String #1 is full! Now writing to string #2.',^g); lowvideo; repeat - read(trm,letter); + letter := ReadKey; + write(letter); if letter = ^h then begin - write(^h,' ',^h); - delete(text2,length(text2),2); + write(' ',^h); + delete(text2,length(text2),1); end; beep; if (letter <> '\') and (letter <> ^h) then text2:=text2+letter @@ -150,13 +178,13 @@ else {Read from 'Rooms'.} begin writeln;writeln; writeln('To the S)creen or the P)rinter?'); - read(kbd,answer); + readln(answer); if(upcase(answer)='P')then List:=True else List:=False; assign(special1,'special1'); reset(special1); writeln('Filesize = ',filesize(special1), ' (From 0 to ',filesize(special1)-1,')'); - close(special1); + writeln('Enter starting position:'); readln(start); if(start > filesize(special1)-5)then stop:=(filesize(special1)-1) else @@ -165,12 +193,10 @@ else {Read from 'Rooms'.} readln(stop); end; Diskread(start,stop); + end; {End of else clause.} writeln;writeln('Another special responce? Y)es or N)o'); -read(kbd,answer); +readln(answer); until upcase(answer) = 'N'; {End of Main loop.} writeln; writeln(^g,'You are now out of the program.') END. - - - -- 2.31.1