The NCHACKS Library Package Xerox Corporation Randy Trigg [Location: {qv}release1.2>library>nchacks.dcom] [First written: 8/23/85 Randy Trigg] [Last updated:] This document describes a library package containing miscellaneous handy functions written using the programmer's interface. It is hoped that you will find these useful not only for their functionality, but also as examples of the sort of code that can be written using the programmer's interface. I encourage any readers who have created such functions themselves to send me the code and a short description and I'll incorporate into this package. The following functions are applicable to sets of cards and allow global searching, replacing, and chain creation. All these functions expect there to be an open notefile. In addition, each of these takes a Cards argument. This should be bound to either a single card ID or a list of card IDs. To run the function over all cards in the notefile, pass the value of (NCP.AllCards) as the Cards argument. To allow user selection of cards, pass the value of (NCP.SelectCards). NCHACKS.TextSearch (String WildCards? Cards ReturnLocsFlg) This goes through the Cards list looking for occurrences of text string String. WildCards? being non-nil means wild card characters may appear in String. The pound sign character '#' matches any single character, asterisk '*' matches any sequence of characters, and single quote, "'" can be used to quote one of the wildcard characters. If ReturnLocsFlg is nil, then this just returns a list of cards containing at least one occurrence of String. If ReturnLocsFlg is non-nil, then this returns a list of lists. Each sublist has as first element a card ID followed by the locations of occurences of String. These are single integers if WildCards? is nil and correspond to the location of the first character of String in the text. If WildCards? is non-nil, then these are two element lists of start and end locations of the matching string. Any cards in Cards that are not text cards are ignored (i.e. their card type must have TEXT substance). NCHACKS.GlobalTextReplace (String1 String2 WildCards? Cards) This goes through the Cards list replacing every occurrence of text string String1 by String2. WildCards? being non-nil means wild card characters may appear in String1. The pound sign character '#' matches any single character, asterisk '*' matches any sequence of characters, and single quote, "'" can be used to quote one of the wildcard characters. Any cards in Cards that are not text cards are ignored (i.e. their card type must have TEXT substance). NCHACKS.DateSearch (DateString1 DateString2 Cards) This goes through the Cards list looking for occurrences of card parts modified between the dates DateString1 and DateString2. If DateString1 is NIL, then it defaults to a very early date. If DateString2 is NIL, then it defaults to current date. If you provide values for either DateString1 or DateString2, they should be strings in the same format as that returned by the (DATE) format, i.e. " 1-Jan-85 00:00:00". This returns a list of lists, one sublist for each card modified between the given dates. This sublist consists of the card ID followed by two-element lists containing the card part name that was modified and the date of last modification. For example, if there were two hits, you might get something like ((NC00001 (SUBSTANCEDATE "23-Aug-85 19:15:27") (TITLEDATE "23-Aug-85 19:15:44"))(NC00023 (LINKSDATE "23-Aug-85 19:16:16"))) NCHACKS.MakeChain (LinkType Cards Position AddCRFlg) This creates links between successive cards in Cards each of type LinkType positioned at Position. Thus the first card in Cards will be linked to the second, the second to the third, etc. (No link will be built from the last card in Cards.) Position should be in the same form as that accepted by NCP.CardAddText, i.e. either an integer location or one of the litatoms START or END. If the AddCRFlg is non-nil and Position is one of START or END, then a carriage return is inserted after the link icon in the case of START or before the link icon in the case of END. Any cards in Cards that are not text cards are ignored (i.e. their card type must have TEXT substance). NCHACKS.RemoveDeletedIconsFromTextCards (Cards) This removes all deleted link icons from the text of those cards in Cards having TEXT substance.  TIMESROMAN  TIMESROMAN TIMESROMAN TIMESROMAN ;%+—Þ;Uûh=ch3¢°5;h0aJaz¹