(FILECREATED " 4-Dec-87 16:14:52" {QV}<NOTECARDS>1.3KNEXT>PMIPATCH073.;1 2844   

      changes to:  (VARS PMIPATCH073COMS)
		   (FNS NCP.CollectCards))


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

(PRETTYCOMPRINT PMIPATCH073COMS)

(RPAQQ PMIPATCH073COMS ((* * pmi 12/4/87: NCP.CollectCards now returns list of cards collected with 
			     NO duplicates.)
			  (* * Changed in NCPROGINT)
			  (FNS NCP.CollectCards)))
(* * pmi 12/4/87: NCP.CollectCards now returns list of cards collected with NO duplicates.)

(* * Changed in NCPROGINT)

(DEFINEQ

(NCP.CollectCards
  (LAMBDA (RootCards LinkTypes MaxDepth FollowCrossFileLinksFlg)
                                                             (* pmi: " 4-Dec-87 15:57")

          (* * Starting from RootCards and following link of types in LinkTypes to a max depth of MaxDepth, collect and 
	  return all cards encountered. LinkTypes can contain backward links.)



          (* * rht 8/29/86: Now handles case of NULL MaxDepth. Also handles case when RootCards is single card instead of 
	  list.)



          (* * rht 6/6/87: Added FollowCrossFileLinksFlg; if non-nil, then try to follow cross-file links into remote 
	  notefiles, else ignore them.)



          (* * pmi 12/4/87: Now returns list of cards collected with NO duplicates.)


    (OR MaxDepth (SETQ MaxDepth 65535))
    (if (LEQ MaxDepth 0)
	then RootCards
      else (LET (RealFringe Collection)
	          (RESETLST (RESETSAVE NIL (QUOTE (PROGN (for Card in Collection
								    do (NC.SetUserDataProp
									   Card
									   (QUOTE SeenBefore)
									   NIL)))))
			      (SETQ RealFringe (MKLIST RootCards))
			      (SETQ Collection (APPEND (MKLIST RootCards)))
			      (for Card in Collection do (NC.SetUserDataProp Card
										     (QUOTE 
										       SeenBefore)
										     T))
			      (for Depth from 1 to MaxDepth eachtime (BLOCK) bind Fringe
				 do (SETQ Fringe (NCP.CardNeighbors RealFringe LinkTypes 
									  FollowCrossFileLinksFlg))
				      (if (NULL Fringe)
					  then (RETURN Collection)
					else (SETQ RealFringe (for Card in Fringe
								     when
								      (NOT (NC.FetchUserDataProp
									       Card
									       (QUOTE SeenBefore)))
								     collect (NC.SetUserDataProp
										 Card
										 (QUOTE SeenBefore)
										 T)
									       (SETQ Collection
										 (CONS Card 
										       Collection))
									       Card)))
				 finally (RETURN Collection)))))))
)
(PUTPROPS PMIPATCH073 COPYRIGHT ("Xerox Corporation" 1987))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (584 2762 (NCP.CollectCards 594 . 2760)))))
STOP