Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.etla.org!aioe.org!.POSTED!not-for-mail From: Helpful Harry Newsgroups: comp.databases.filemaker Subject: Re: No Matching Records in a Script Find Date: Tue, 14 Apr 2015 19:28:08 +1200 Organization: Aioe.org NNTP Server Lines: 55 Message-ID: <140420151928086579%HelpfulHarry@BusyWorking.com> References: <1m2sjtb.7ukigzgagojdN%csampson@inetworld.net> <2b8f9$552b98cc$52d9780b$30967@news.ziggo.nl> <140420151351494073%HelpfulHarry@BusyWorking.com> <1m2uzcu.1eb5o0s1taqppoN%clkaufmann@gmx.ch> NNTP-Posting-Host: tmj6zLGEXPFwfvoBJw6yZg.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: Thoth/1.8.4 (Carbon/OS X) X-Notice: Filtered by postfilter v. 0.8.2 X-Face: vIZzK[X\z-._]-_:U?l@cBtwg<{a>ggn\mH}Vs>38E,#R%7h%U0'=4;1Q=erO %[T#a{YJfGvAbWmE@f_h], Christoph Kaufmann wrote: > Helpful Harry wrote: > > [Filemaker 5.5 or anything up to 7] > > For example, a Find script might be something like: > > > > Set Error Capture [On] > > Perform Find [] > > Set [gErrorCode; Get(LastError)] A script like that will also work in older versions of FileMaker, but you need to replace the Get(LastError) function with the Status(CurrentError) function. > Filemaker introduced script variables in version 8, meaning you don't > need to bother with a global field. The step would be > > SetVariable ( $SearchError ; Get ( LastError ) ) > > Variables are like global fast, but you don't have to set them up as > fields, and they're faster. You still need global fields > > a) if you want the user to enter something > b) if you need the value on the left side of relation Yep, I did say you could use a Variable instead. There may also be occasions when you want to use a normal Field instead. > When evaluating a scripted find, you may also use Get ( FoundCount ) > rather than checking for error 401. True if you're only worried about not finding any records, and that's usually the way I do it. You still need the Set Error Capture [On] command to stop FileMaker displaying its normal error window. i.e. Enter Find Mode [] Set Field [MyField; "Find Me"] Set Error Capture [On] Perform Find [] If [Get(FoundCount) <> 0] {perform whatever script commands are to be done with the found records} Else Show Custom Dialog ["There are no records with the text 'Find Me'"; "OK"] End If Helpful Harry :o)