(FILECREATED "28-Sep-85 18:05:16" {QV}<NOTECARDS>RELEASE1.2I>FGHPATCH024.;1 3024 changes to: (VARS FGHPATCH024COMS) (FNS NC.CollectAndCheckLinks)) (* Copyright (c) 1985 by Xerox Corporation. All rights reserved.) (PRETTYCOMPRINT FGHPATCH024COMS) (RPAQQ FGHPATCH024COMS ((* * Minor fix to handle card types with no links. Redefined from NCREPAIR) (FNS NC.CollectAndCheckLinks))) (* * Minor fix to handle card types with no links. Redefined from NCREPAIR) (DEFINEQ (NC.CollectAndCheckLinks (LAMBDA (ID DatabaseStream ListOfValidCards) (* fgh: "28-Sep-85 18:04") (* Return the list of all of the NoteCardLinks in the substance of NoteCard ID. Check each link to make sure it is legal. If not legal delete it from the substance.) (* Assumes that the ID is already an active NoteCard) (PROG (NoteCardType Links DirtyFlg ActualLink GlobalLinks LinkIcon LinksDirtyFlg CollectReferencesFn) (SETQ NoteCardType (NC.FetchType ID)) (* Collect the links. Check the validity of each link and delete it if it is not a valid link.) (COND ((SETQ CollectReferencesFn (NC.CollectReferencesFn NoteCardType)) (SETQ Links (APPLY* CollectReferencesFn ID T DatabaseStream)) (SETQ DirtyFlg (CDR Links)) (SETQ Links (CAR Links)))) (* * Process the GlobalLinks as well .... same for all substance types) (SETQ Links (NCONC Links (for Link in (SETQ GlobalLinks (for GlobalLink in (NC.FetchGlobalLinks ID) eachtime (BLOCK) when (COND ((AND (LISTP ListOfValidCards) (FMEMB (fetch (NOTECARDLINK DESTINATIONID) of GlobalLink) ListOfValidCards))) ((NC.ValidLinkP GlobalLink DatabaseStream T)) (T (SETQ LinksDirtyFlg T) NIL)) collect GlobalLink)) eachtime (BLOCK) when (NEQ (fetch (NOTECARDLINK DESTINATIONID) of Link) (QUOTE NC00000)) collect Link))) (NC.SetGlobalLinks ID GlobalLinks) (* * Update list of valid cards with good links returned from Collect references) (AND (LISTP ListOfValidCards) (NCONC ListOfValidCards (for Link in Links eachtime (BLOCK) collect (fetch (NOTECARDLINK DESTINATIONID) of Link)))) (* * Write out the card or links if it has been modified) (AND DirtyFlg (NC.PutNoteCard ID DatabaseStream)) (AND LinksDirtyFlg (NC.PutLinks ID DatabaseStream)) (RETURN Links)))) ) (PUTPROPS FGHPATCH024 COPYRIGHT ("Xerox Corporation" 1985)) (DECLARE: DONTCOPY (FILEMAP (NIL (493 2942 (NC.CollectAndCheckLinks 503 . 2940))))) STOP