(FILECREATED "18-Jan-88 17:16:50" {QV}<NOTECARDS>1.3KNEXT>NCLISTCARD.;4 5681   

      changes to:  (FNS NC.EvaluateListCardSubstance)

      previous date: "14-Jul-87 20:44:53" {QV}<NOTECARDS>1.3KNEXT>NCLISTCARD.;3)


(* Copyright (c) 1985, 1986, 1987, 1988 by Xerox Corporation. All rights reserved.)

(PRETTYCOMPRINT NCLISTCARDCOMS)

(RPAQQ NCLISTCARDCOMS [(* * The list card -- just a Lisp list stored on the file!)
			 (FNS NCAddStub.ListCard)
			 (FNS NC.AddListCard NC.ListCardCopyFn NC.ListCardCreateFn NC.ListCardEditFn 
			      NC.ListCardGetFn NC.ListCardPutFn NC.EvaluateListCardSubstance)
			 (DECLARE: DONTEVAL@LOAD (P (NC.AddListCard])
(* * The list card -- just a Lisp list stored on the file!)

(DEFINEQ

(NCAddStub.ListCard
  (LAMBDA NIL                                                (* kirk: "19-Jun-86 20:52")

          (* * kirk 18Jun86 Add the text card stub)


    (NC.AddCardTypeStub (QUOTE List)
			  (QUOTE NoteCard)
			  (QUOTE NCLISTCARD))))
)
(DEFINEQ

(NC.AddListCard
  (LAMBDA NIL                                                (* rht: "14-Jul-86 00:53")

          (* * rht 7/14/86: No longer has a QuitFn.)


    (NC.AddCardType (QUOTE List)
		      (QUOTE NoteCard)
		      (BQUOTE ((MakeFn , (FUNCTION NC.ListCardCreateFn))
				 (EditFn , (FUNCTION NC.ListCardEditFn))
				 (GetFn , (FUNCTION NC.ListCardGetFn))
				 (PutFn , (FUNCTION NC.ListCardPutFn))
				 (CopyFn , (FUNCTION NC.ListCardCopyFn))
				 (MarkDirtyFn , (FUNCTION NILL))
				 (DirtyPFn , (FUNCTION NILL))
				 (QuitFn , (FUNCTION NILL))))
		      (QUOTE ((LinkAnchorModesSupported NIL))))))

(NC.ListCardCopyFn
  (LAMBDA (Card FromStream ToStream Length)                  (* fgh: "21-Nov-85 21:11")

          (* * Copy a list substance from FromStream to ToStream.)



          (* * Copy the bytes,)



          (* * fgh 11/20/85 NoteCards now handles the start and end ptrs -- passing the from ptrs as args and properly 
	  setting the to ptrs.)



          (* * fgh 11/21/85 Now passes length instead of start and end ptrs.)


    (LET* ((FromStartPtr (GETFILEPTR FromStream))
	   (FromEndPtr (PLUS Length FromStartPtr)))
          (COPYBYTES FromStream ToStream FromStartPtr FromEndPtr))
    T))

(NC.ListCardCreateFn
  (LAMBDA (Card Title NoDisplayFlg InitialSetting)           (* fgh: "17-Nov-85 15:59")

          (* * Make a list substance.)


    (NC.SetSubstance Card InitialSetting)
    Card))

(NC.ListCardEditFn
  (LAMBDA NIL                                                (* fgh: "14-Nov-85 00:51")
    (NC.ReportError NIL "Cannot edit a list substance")))

(NC.ListCardGetFn
  [LAMBDA (Card Length Stream)                               (* rht: " 1-Nov-86 15:57")

          (* * Get the list substance from the disk)



          (* * fgh 11/20/85 NoteCards now passes start and end ptrs down.)



          (* * fgh 11/21/85 Now passes length instead of start and end ptrs.)



          (* * rht 1/23/86: Now takes Stream as arg instead of computing from Card.)



          (* * rht 11/1/86: Now uses our readtable when reading.)


    (DECLARE (GLOBALVARS NC.OrigReadTable))
    (READ Stream NC.OrigReadTable])

(NC.ListCardPutFn
  [LAMBDA (Card Stream)                                      (* rht: " 1-Nov-86 15:57")
                                                             (* Put list substance)

          (* * fgh 11/20/85 NoteCards now takes care of setting the start and end pointers for the substance.)



          (* * rht 1/23/86: Now takes Stream as arg instead of computing from Card.)



          (* * fgh 2/6/86 Now returns version number.)



          (* * rht 11/1/86: Now uses our readtable when printing.)


    (DECLARE (GLOBALVARS NC.OrigReadTable))
    (PRINT (NC.FetchSubstance Card)
	     Stream NC.OrigReadTable)
    0])

(NC.EvaluateListCardSubstance
  [LAMBDA (CardOrList Message InterestedWindow ExitOnDontFlg)
                                                             (* pmi: "10-Dec-87 14:10")

          (* * Evaluate the contents of a list card.)



          (* * rht 4/2/87: Added InterestedWindow arg.)



          (* * rht 4/19/87: Now clears InterestedWindow before printing.)



          (* * dsj 11/5/87: Changed Card arg to CardOrList to allow lists to be passed in for the case where this fn is 
	  called after the notefile has been closed and the card is no longer accessible. Now exits if any exprs return DON'T
	  if ExitOnDontFlg is non-NIL.)



          (* * pmi 12/10/87: added dsj's changes; see above comments.)


    (LET (CardEvents)
         (SETQ CardEvents (if (LISTP CardOrList)
				then CardOrList
			      else (NCP.CardSubstance CardOrList)))
         [OR InterestedWindow (AND (NOT (LISTP CardOrList))
				       (SETQ InterestedWindow (NC.CoerceToInterestedWindow 
										       CardOrList]
         (if Message
	     then (NC.PrintMsg InterestedWindow T Message))
         (if ExitOnDontFlg
	     then [CAR (ERSETQ (if (for Item in CardEvents
					      thereis (EQ (CAR (ERRORSET Item))
							      (QUOTE DON'T)))
					 then (QUOTE DON'T]
	   else (ERSETQ (for Item in CardEvents do (ERRORSET Item])
)
(DECLARE: DONTEVAL@LOAD 
(NC.AddListCard)
)
(PUTPROPS NCLISTCARD COPYRIGHT ("Xerox Corporation" 1985 1986 1987 1988))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (728 1017 (NCAddStub.ListCard 738 . 1015)) (1018 5541 (NC.AddListCard 1028 . 1701) (
NC.ListCardCopyFn 1703 . 2353) (NC.ListCardCreateFn 2355 . 2574) (NC.ListCardEditFn 2576 . 2752) (
NC.ListCardGetFn 2754 . 3351) (NC.ListCardPutFn 3353 . 4035) (NC.EvaluateListCardSubstance 4037 . 5539
)))))
STOP