Make encode77 default to reading from "messages.txt".

This commit is contained in:
Joe Taylor 2018-06-28 13:17:32 -04:00
parent 4946d01edb
commit 5465abaa72
2 changed files with 8 additions and 6 deletions

View File

@ -1,19 +1,20 @@
program encode77 program encode77
character msg*37,msg0*37,msg1*37,cerr*1 character msg*37,msg0*37,cerr*1
character*77 c77 character*77 c77
nargs=iargc() nargs=iargc()
open(10,file='messages.txt',status='old')
do iline=1,999 do iline=1,999
if(nargs.eq.1) then if(nargs.eq.1) then
call getarg(1,msg0) call getarg(1,msg0)
else else
read(*,1002,end=999) msg0 read(10,1002,end=999) msg0
1002 format(a37) 1002 format(a37)
endif endif
if(msg0.eq.' ') exit if(msg0.eq.' ') exit
msg1=msg0 call pack77(msg0,i3,n3,c77)
call pack77(msg1,i3,n3,c77)
call unpack77(c77,msg) call unpack77(c77,msg)
cerr=' ' cerr=' '
if(msg.ne.msg0) cerr='*' if(msg.ne.msg0) cerr='*'

View File

@ -1,13 +1,14 @@
subroutine pack77(msg,i3,n3,c77) subroutine pack77(msg0,i3,n3,c77)
use packjt use packjt
character*37 msg character*37 msg,msg0
character*18 c18 character*18 c18
character*13 w(19) character*13 w(19)
character*77 c77 character*77 c77
integer nw(19) integer nw(19)
integer ntel(3) integer ntel(3)
msg=msg0
if(i3.eq.0 .and. n3.eq.5) go to 5 if(i3.eq.0 .and. n3.eq.5) go to 5
! Convert msg to upper case; collapse multiple blanks; parse into words. ! Convert msg to upper case; collapse multiple blanks; parse into words.