(FILECREATED "27-Aug-86 18:26:14" {QV}<NOTECARDS>1.3K>NEXT>RHTPATCH094.;4 3798   

      changes to:  (VARS RHTPATCH094COMS)
		   (FNS NC.GetAndPutVersion2Card))


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

(PRETTYCOMPRINT RHTPATCH094COMS)

(RPAQQ RHTPATCH094COMS ((* * Change to NCCONVERTVERSION2TO3)
			  (FNS NC.GetAndPutVersion2Card)))
(* * Change to NCCONVERTVERSION2TO3)

(DEFINEQ

(NC.GetAndPutVersion2Card
  (LAMBDA (Stream ID Version2HashArray FromNoteFile ToNoteFile)
                                                             (* rht: "27-Aug-86 18:26")

          (* * If ID has active status, then get its card parts off Stream and fill in the info into the corresponding card 
	  object. Find this object using Version2HashArray.)



          (* * rht 12/18/85: Now deactivates card after putting to file.)



          (* * fgh 5/20/86 Added extra Version2HashArray arg to call to NC.ReadVersion2Links to support GlobalLinkConversion.
	  Changed order in which Links and PropList are processed because global link conversion might need to put a NoSource
	  property on the prop list.)



          (* * rht 8/27/86: Now sets status to ACTIVE before reading card parts so that user code calling progintface 
	  functions will work okay, i.e. that card will be NC.ValidCardP.)


    (LET ((Pointers (NC.ReadVersion2Ptrs ID Stream))
	  Card)
         (SELECTQ (fetch (POINTERLIST STATUS) of Pointers)
		    (ACTIVE                                  (* Recover card object from the hash array.)
			    (SETQ Card (GETHASH ID Version2HashArray))

          (* * Set status to be active.)


			    (NC.SetStatus Card (QUOTE ACTIVE))

          (* * Read main data and substance and fill in Card object.)


			    (SETFILEPTR Stream (fetch (POINTERLIST MAINPTR) of Pointers))
			    (NC.ReadVersion2MainCardData Stream ID Card Version2HashArray 
							   FromNoteFile ToNoteFile)

          (* * Read title and fill in Card object.)


			    (SETFILEPTR Stream (fetch (POINTERLIST TITLEPTR) of Pointers))
			    (NC.ReadVersion2Title Stream ID Card)

          (* * Read prop list and fill in Card object.)


			    (SETFILEPTR Stream (fetch (POINTERLIST PROPSPTR) of Pointers))
			    (NC.ReadVersion2PropList Stream ID Card)

          (* * Read global links and fill in Card object.)


			    (SETFILEPTR Stream (fetch (POINTERLIST LINKSPTR) of Pointers))
			    (NC.ReadVersion2Links Stream ID Card Version2HashArray)

          (* * If card is a browser, then first convert to version 3 format.)


			    (if (NC.IsSubTypeOfP (NC.FetchType Card)
						     (QUOTE Browser))
				then (NC.ConvertVersion2BrowserCard Card Version2HashArray))

          (* * Write down the card parts to the ToNoteFile.)


			    (NC.PutMainCardData Card NIL T)
			    (NC.PutLinks Card T)
			    (NC.PutTitle Card T)
			    (NC.PutPropList Card T))
		    (SPECIAL                                 (* Deal specially with link labels.)
			     (SETQ Card (NC.Version3CardFromVersion2ID ID Version2HashArray))
                                                             (* Go get the link labels from version 2 stream and 
							     write down to version 3 notefile.)
			     (SETFILEPTR Stream (fetch (POINTERLIST MAINPTR) of Pointers))
			     (NC.StoreLinkLabels ToNoteFile (NC.ReadVersion2LinkLabels Stream ID 
											   Card)))
		    NIL)
         (AND (NC.CardP Card)
		(NC.DeactivateCard Card T))
     Card)))
)
(PUTPROPS RHTPATCH094 COPYRIGHT ("Xerox Corporation" 1986))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (417 3716 (NC.GetAndPutVersion2Card 427 . 3714)))))
STOP