[comp.os.vms] EDT$EDIT re-entry after error

perry@vu-vlsi.Villanova.EDU (Rick Perry) (04/07/88)

As the following program demonstrates, if you recover from an error
during a call to edt$edit, subsequent calls to edt$edit produce the
same error as the first bad call.  It's as though edt$edit saves some
static info from the previous bad call, and I haven't been able to figure
out any way to 'reset' it.

In this example I'm running the test program with my default dir in a
place not writable by me (E:).  After the first error, specifying
a file that is writable by me (in R:) produces the previous error message
again.  Anyone know any way around this?

...Rick			perry@vu-vlsi.UUCP, perry@vuvaxcom.BITNET

Dr. Rick Perry, Department of Electrical Engineering
Villanova University, Villanova, PA 19085, 215-645-4969, -4970

$ run r:edit
File: j.dat
%MYPROG-F-OPENOUT, error opening E:[WORK]J.JOU; as output
-RMS-E-PRV, insufficient privilege or file protection violation
File: r:[work]k.dat
%MYPROG-F-OPENOUT, error opening E:[WORK]J.JOU; as output
-RMS-E-PRV, insufficient privilege or file protection violation
File: ^Z
$ 
$ type r:[work]edit.for

	program edit
	implicit none
	character*60 fname
	external handler
	call lib$establish(handler)
10	write(6,'(1x,a,$)') 'File: '
	read(5,'(a)',end=99,err=99) fname
	call edt$edit(fname)
	goto 10
99	end

	integer function handler( sa, ma)
	implicit none
	integer sa(*), ma(*)
	sa(1) = sa(1) - 2	! eliminate PC & PSL from messages
	call sys$putmsg(sa,,'MYPROG')
	call sys$unwind(1)	! return to caller of signaler
	return
	end
$