Path: utzoo!censor!geac!torsqnt!hybrid!scifi!bywater!uunet!world!aep From: aep@world.std.com (Andrew E Page) Newsgroups: comp.sys.mac.programmer Subject: Re: Adding a filter function to Standard File Dialog (how?) Message-ID: <1991Jan19.150555.16334@world.std.com> Date: 19 Jan 91 15:05:55 GMT References: <28003.27975c37@kuhub.cc.ukans.edu> Organization: The World Public Access UNIX, Brookline, MA Lines: 41 A "filter" function supplies you with another layer of file 'filtering' beyond the typelist that you pass to SFGetFile. What is passed is a fileParam paraeter block which contains everying you would ever want to know about the file, or the means to get to it. The filter function will return a TRUE (To include file in the list), or FALSE (to exclude it) for example... if your program wanted to only look at MS Word text files where the type is TEXT and the creattor is 'MSWD' you would use a type list with one type 'TEXT' and inside the filter you would do a : pascal boolean MyFilter(fileParam *f) { if( f->ioFlFndrInfo.fdCreator == 'MSWD' ) return TRUE ; else return FALSE ; } Sorry that it's in C. Pascal give's me hives when mentioned and I get convulsions when forced to work with it. ADVICE: If you are serious about Mac programming: S P E N D T H E M O N E Y and buy IM I-IV or at least the Macintosh Revealed series. Another great tool is "Programmer's Online Guide" also from addison Wessely. -- **************************************************************************** Andrew E. Page (Warrior Poet) | Decision and Effort The Archer and Arrow Concepts Engineering | The difference beteween what we are