• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: FMP question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FMP question


  • Subject: Re: FMP question
  • From: Shane Stanley <email@hidden>
  • Date: Thu, 02 Nov 2000 08:59:20 +1100

On 2/11/00 6:03 AM +1000, Paul Berkowitz, email@hidden, wrote:

> Thanks. Here it is.

There's room for improvement there. The key is to keep the number of events
to a minimum.

The first thing to do is to create a new layout (or layouts) in the database
that contains only the fields you'll be concerned about, in the order you
want to deal with them. By addressing this layout, you can simplify things
greatly.

For example, if there are seven fields you are interested in, you can do
this:

tell layout x
create new record at end with data {a, b, c, d, e, f, g}
end tell

This is much quicker than creating the record and then putting in the data
(lthough there are quicker ways still, especially if you are importing more
than a handful of records at a time).

As for your search for duplicates, you're ignoring the whose clause; let FMP
do the searching for you (using a new layout):

tell database 1
tell layout y
record 1 whose cellValue of cells = {b, f, c, d, e}
end tell
end tell

Note that this uses FMP's sloppy matching ("Johnson" will match "John") and
will give an error if no match is found. So your safest method is to do
something like:

tell database 1
tell layout y
try
set x to record 1 whose cellValue of cells = {b, f, c, d, e}
on error
set n to ""
end try
end tell
if n  {b, f, c, d, e} then
tell layout x
create new record at end with data {a, b, c, d, e, f, g}
end tell
end if
end tell

That should speed things up quite a bit. But if you're going to be getting
more than a handful of records at a time, there are ways that are
considerably faster still...

--
Shane Stanley, email@hidden


  • Follow-Ups:
    • Re: FMP question
      • From: Paul Berkowitz <email@hidden>
    • Re: FMP question
      • From: Paul Berkowitz <email@hidden>
References: 
 >Re: FMP question -- for Shane Stanley? (From: Paul Berkowitz <email@hidden>)

  • Prev by Date: Re: FMP question -- for Shane Stanley?
  • Next by Date: Re: FMP question
  • Previous by thread: Re: FMP question -- for Shane Stanley?
  • Next by thread: Re: FMP question
  • Index(es):
    • Date
    • Thread