Re: Three simple FMP questions
Re: Three simple FMP questions
- Subject: Re: Three simple FMP questions
- From: Shane Stanley <email@hidden>
- Date: Mon, 09 Jul 2001 14:16:53 +1000
On 9/7/01 1:34 PM +1000, Paul Berkowitz, email@hidden, wrote:
>
Ah. It might be a good idea after 5 versions (and I presume also after 5.5
>
versions) if they put that bit of information into the Dictionary, perhaps.
>
Useful information.
Do look at the database in the folder called FileMaker and Apple Events
inside the FileMaker folder. It has a lot of useful info.
>
>
It seems that FMP always recreates the found set (document) it last
>
displayed at closing, which is convenient for my purposes. But what if you
>
wanted to recreate a different (previous) found set?
Do a find:
show every record where cell "Name" of it is "Paul"
>
>
It first looked as if I couldn't even get the composition of a found set,
>
since record is not an element of document, according to the Dictionary, but
>
only of database. But - lo and behold - I _can_ get every record of the
>
document, and only those. One of those 'secret' dictionaries, evidently.
From the aforementioned docs:
"Since a Database object is a FileMaker Pro file considered only as a
collection of fields and records, choose Database instead of Document when
you want FileMaker Pro to ignore temporary states of the document, like the
found set, when evaluating your request.
"For example, if you ask for record 1 of database 1, you will get the first
record in the database regardless of found set. If you ask for record 1 of
document 1, you will get the first record in the current found set, if there
is one."
>
It looks as if I have to check for the class of item 1 of record 1, since if
>
there's only 1 record in the document then 'every record' is actually a list
>
of every cell in record 1, whereas otherwise it's a lists of lists.
This is the old AS problem of a single item not being returned as a list --
except in this case the item _itself_ is a list.
>
(I sure hope that the contents of a cell can never be a list: I don't see
how.)
Repeating fields, fields in portals...
>
>
I bet someone thought this was clever too - to default to just a record,
>
rather than a single-item list of records when there's just one. Sure.
See above; it's consistent with normal AS behavior.
>
>
But how do I specify the display of just those records? If I've a variable
>
'foundRecs' to the to list of lists (of cells) representing the list of
>
records, I can't
>
>
show foundRecs
>
>
What would be the right way to do this?
You need to do a find, aka show.
>
>
> FWIW, you can easily avoid the whole conundrum by just referring to document
>
> x whenever you want to refer to a found set and database x when you want to
>
> refer to a database.
>
>
Except that document x doesn't exist once you close it and reopen the
>
database, right? You have to recreate it by specifying the records. Is there
>
a way to do this?
As you've seen, you'll get whatever was showing last time.
--
Shane Stanley, email@hidden