Re: Three simple FMP questions
Re: Three simple FMP questions
- Subject: Re: Three simple FMP questions
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 08 Jul 2001 20:34:28 -0700
Thank you, Shane for your informative and wry replies. (And kim, too, only I
think you got the document/database thing backwards. Ah, you just corrected
it. Thanks)
On 7/8/01 6:45 PM, "Shane Stanley" <email@hidden> wrote:
>
On 9/7/01 11:10 AM +1000, Paul Berkowitz, email@hidden, wrote:
>
>
> 1) Is there any way to get the file path of an open FMP document, so that
>
> you can close it, then re-open it later? Or any other way to do the same
>
> thing?
>
>
No. This has been much complained about.
OK. I can get the user to keep all databases in the same folder and get it
as a 'choose folder' alias on first run. That would allow the user to create
new databases in the future and store them in the same place, or display a
long-standing error message if it can't be found. It will have to do.
>
>
>
> 2) Is 'database' _really_ an element of 'document', in the usual meaning?
>
>
Depends on the usual meaning of "usual meaning". ;-)
Yeah, yeah.
>
>
> Can you have more than database belonging to the same document?
>
>
No. But that doesn't mean it can't be an element.
>
>
> It seems to me that 'document' and 'database'
>
> refer to the same object except insofar as you need to get a particular
>
> property you have to use one designation or the other, yes?
>
>
A database is all the data; a document is the found set of records.
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.
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?
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. 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. (I sure
hope that the contents of a cell can never be a list: I don't see how.)
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.
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?
>
>
>
> 3) I don't seem to be able to 'get' every database (or document), nor any
>
> property, such as 'name', of 'every database' (or document) but I can 'set n
>
> to count (every document)', then do a repeat loop to get the name of each
>
> one. Is this the only way to do it?
>
>
I believe so. I suspect this is an artifact of the fact that you don't
>
actually have to specify a database or document at all (if you want to live
>
dangerously).
I see...
>
>
> That in itself seems odd, and it's
>
> still not helping find a way to close and reopen any of them.
>
>
I don't think it's to be found.
Got it.
>
>
>
> Does anyone have any idea why such a nutty object model was concocted? Is
>
> there some advantage?
>
>
As it was explained to me here by someone who thought it perfectly natural,
>
database refers just to a whole lot of data, whereas document refers to more
>
than that, in that it has information as to how it's displayed. Hence,
>
database is an element of document. Doesn't seem at all natural to me, but
>
maybe that's just me.
Nope. It seems backwards to me.
>
>
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?
--
Paul Berkowitz