/* PNR - Post Net Request */

address spot
options results

signal on Syntax
signal on failure
options failat 20



parse arg area,reqid,fpost

'gotoarea NAME 'area
if rc=0 then do
	'messagelist'

	'include "'reqid'" subject UNREAD NOGUI NOREQ'

	'Getnumselected'
        selected=RESULT

        'firstmessage'

	'progressopen TITLE "Imp Post Netmail Request" Prompt "0 Posted"'
	progdat=result

	do while ~(current=selected+1)

		'nextmarked'
		'getfrom'
		from=result
		'GetFromAddress'
		FromAddress=RESULT
		'GetSubject'
		Subject=RESULT
		'matrixreply TO "'from'" TOADDR "'fromaddress'" FROM "'yname'" SUBJECT "Imp NetReq Response" ORIGIN "Imp Master V1.0 (C) Steve Pearson" FILE "'fpost'" nosig noedit nogui'
		current=current+1
	        'progressupdate REQ "'progdat'" CURRENT "'current'" TOTAL "'selected'" PROMPT "'current' Posted"'
		if rc=5 then do current=selected+1
	end
end

'progressclose ' progdat

/* Mark them us read and replied so they don't bother you */
/* The report tells you the files were requested */

'clearflags UNREAD UNREPLIED'

'excludeflag ALL'

exit selected

syntax:
failure:

signal off failure
signal off syntax

parse source . . . program

program = subword(program,1,words(program)-2)

call 'spot/impmaster/imperror'(program,rc,sigl,sourceline(sigl))

exit
