(FILECREATED "30-Apr-87 16:26:19" {QV}<NOTECARDS>1.3K>NEXT>RHTPATCH251.;1 4114   

      changes to:  (VARS RHTPATCH251COMS)
		   (FNS NC.ProcessNoteFileNeedsTruncationError))


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

(PRETTYCOMPRINT RHTPATCH251COMS)

(RPAQQ RHTPATCH251COMS ((* * Fixes bug reported by Kirk: NC.ProcessNoteFileNeedsTruncationError 
			     breaks with a shouldn't happen if the user selects outside of the menu 
			     asking whether to truncate or not.)
			  (* * Change to NCDATABASE)
			  (FNS NC.ProcessNoteFileNeedsTruncationError)))
(* * Fixes bug reported by Kirk: NC.ProcessNoteFileNeedsTruncationError breaks with a 
shouldn't happen if the user selects outside of the menu asking whether to truncate or not.)

(* * Change to NCDATABASE)

(DEFINEQ

(NC.ProcessNoteFileNeedsTruncationError
  (LAMBDA (NoteFile NoteFilesHashArray Don'tCacheTypesAndTitlesFlg Don'tCreateFlg 
		    Convertw/oConfirmFlg Don'tCreateArrayFlg Can'tTruncateFlg Don'tCreateInterfaceFlg 
		    Don'tGetSpecialCardsFlg PromptWindow PublicOrPrivate MenuPosition QuietFlg 
		    ReadOnlyFlg Don'tCheckForTruncationFlg)
                                                             (* rht: "30-Apr-87 16:22")

          (* * Discovered NoteFile needs version truncation when attempted to open it. Process that error.)



          (* * fgh 5/23/86 First created.)



          (* * fgh 9/1/86 Updated args to match NC.OpenNoteFile.)



          (* * rht 10/29/86: Changed name from Abort to Cancel.)



          (* * rht 10/31/86: Added Don'tCheckForTruncationFlg arg.)



          (* * rht 4/30/87: No longer breaks when user selects outside of menu.)


    (PROG (TruncationFn)

          (* * If appropriate, notify the user.)


	    (if (WINDOWP PromptWindow)
		then (NC.PrintMsg PromptWindow T "NoteFile " (fetch (NoteFile FullFileName)
								    of NoteFile)
				      
			    " has information written since last successful close or checkpoint."
				      (CHARACTER 13)))

          (* * If the device has a TruncationFn then apply it and try to Open the NoteFile.)


	    (if (AND (NULL Can'tTruncateFlg)
			 (SETQ TruncationFn (fetch (NoteFile TruncateNoteFileFn) of NoteFile)))
		then 

          (* * ASk the user if they want to truncate, or abort, or repair the notefile.)


		       (SELECTQ (NC.AskUserAboutTruncation NoteFile PromptWindow)
				  (Cancel (RETURN (QUOTE CancelOpen)))
				  (Inspect% &% Repair (RETURN (NC.ProcessInspectAndRepairRequest
								  NoteFile NoteFilesHashArray 
								  Don'tCacheTypesAndTitlesFlg 
								  Don'tCreateFlg Convertw/oConfirmFlg 
								  Don'tCreateArrayFlg 
								  Can'tTruncateFlg 
								  Don'tCreateInterfaceFlg 
								  Don'tGetSpecialCardsFlg 
								  PromptWindow PublicOrPrivate 
								  MenuPosition QuietFlg ReadOnlyFlg 
								  Don'tCheckForTruncationFlg)))
				  (Truncate% File (RETURN (NC.ProcessTruncationRequest NoteFile 
									       NoteFilesHashArray 
								      Don'tCacheTypesAndTitlesFlg 
										   Don'tCreateFlg 
									     Convertw/oConfirmFlg 
									      Don'tCreateArrayFlg 
										 Can'tTruncateFlg 
									  Don'tCreateInterfaceFlg 
									  Don'tGetSpecialCardsFlg 
										     PromptWindow 
										  PublicOrPrivate 
										     MenuPosition 
											 QuietFlg 
										      ReadOnlyFlg 
								       Don'tCheckForTruncationFlg)))
				  (RETURN (QUOTE CancelOpen)))
	      else 

          (* * No TruncationFn. Tell the user if appropriate and return an error msg.)


		     (if (WINDOWP PromptWindow)
			 then (NC.PrintMsg PromptWindow NIL 
					       "No file truncation possible for this NoteFile."
					       (CHARACTER 13)
					       "See a NoteCards wizard."
					       (CHARACTER 13)))
		     (RETURN (QUOTE NoteFileNeedsTruncation))))))
)
(PUTPROPS RHTPATCH251 COPYRIGHT ("Xerox Corporation" 1987))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (813 4032 (NC.ProcessNoteFileNeedsTruncationError 823 . 4030)))))
STOP