(FILECREATED " 9-Dec-86 10:07:27" {QV}<NOTECARDS>1.3K>NEXT>PMIPATCH005.;2 2712   

      changes to:  (VARS PMIPATCH005COMS)
		   (FNS NC.GetFileFromUser)

      previous date: " 4-Dec-86 10:16:46" {QV}<NOTECARDS>1.3K>NEXT>PMIPATCH005.;1)


(* Copyright (c) 1986 by Xerox Corporation. All rights reserved.)

(PRETTYCOMPRINT PMIPATCH005COMS)

(RPAQQ PMIPATCH005COMS ((* * Fixes bug #171: Typing <CR> when prompted for file name for new File 
			     card now aborts instead of bugging you for a file.)
			  (FILES (FROM NOTECARDS)
				 NCFILECARD)
			  (* * Change to NCFILECARD)
			  (FNS NC.GetFileFromUser)))
(* * Fixes bug #171: Typing <CR> when prompted for file name for new File card now aborts 
instead of bugging you for a file.)

(FILESLOAD (FROM NOTECARDS)
	   NCFILECARD)
(* * Change to NCFILECARD)

(DEFINEQ

(NC.GetFileFromUser
  (LAMBDA (Window DontClearPromptFlg FirstTry)               (* pmi: " 4-Dec-86 10:09")

          (* * Create a file designator)



          (* * pmi 12/4/86: Added first check for FileName, returns immediately if NULL.)


    (PROG (FileName FullFileName)
	    (SETQ FileName (NC.AskUser "Enter file name" ":  " FirstTry (NULL 
									       DontClearPromptFlg)
					   Window T NIL T))
	    (RETURN (PROG1 (if (NULL FileName)
				   then NIL
				 elseif (SETQ FullFileName (INFILEP FileName))
				   then (PACKFILENAME (QUOTE VERSION)
							  NIL
							  (QUOTE BODY)
							  FullFileName)
				 elseif (NULL (SETQ FullFileName (FULLNAME FileName
										   (QUOTE NEW))))
				   then (NC.PrintMsg Window T FileName 
							 " is not a legal file name."
							 (CHARACTER 13)
							 "Please try again."
							 (CHARACTER 13))
					  (NC.GetFileFromUser Window T)
				 elseif (NC.YesP (NC.AskUser (CONCAT 
								      "Do you want me to create "
									     FullFileName)
								   " ? " "Yes" T Window NIL NIL T))
				   then (PACKFILENAME (QUOTE VERSION)
							  NIL
							  (QUOTE BODY)
							  (CLOSEF (PROG1 (SETQ FileName
									       (OPENSTREAM
										 FileName
										 (QUOTE OUTPUT)
										 (QUOTE NEW)))
									     (BOUT FileName 32))))
				 elseif (NC.YesP (NC.AskUser 
						      "Do you want to specify another file name?"
								   " -- " "No" T Window NIL NIL T))
				   then (NC.GetFileFromUser Window DontClearPromptFlg FirstTry)
				 else NIL)
			       (AND Window (REMOVEPROMPTWINDOW Window)))))))
)
(PUTPROPS PMIPATCH005 COPYRIGHT ("Xerox Corporation" 1986))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (831 2630 (NC.GetFileFromUser 841 . 2628)))))
STOP