Re: FMP Container
Re: FMP Container
- Subject: Re: FMP Container
- From: Kai Edwards <email@hidden>
- Date: Wed, 23 Jan 2002 20:15:33 +0100
on 22 Jan 2002 23:50:08 -0500, John McAdams <email@hidden>
wrote:
>
Is there a way to find out if a container field in FileMaker is empty?
>
The example syntax in the "Find Script" works on regular text fields:
>
>
show (every record of database 1 whose cell "First Name" = "")
>
>
However I can't get it to work on a container field. The idea is to find
>
all the empty pictures fields, grab the file name from a text field,
>
search a folder for the image and then place it into the picture field.
If there is a direct way of doing this with a container field, it's not
obvious to me.
The FMP dictionary seems to be devoid of anything that might help. (Please
note that, on behalf of my clients, I'm still locked in to version 4.0.)
When queried from AS, the value of an FMP container field is returned as one
of the following:
container field containing a picture: +data PICT(x);
container field containing a sound: +data snd (x);
container field containing nothing: +data PICT;
- where (x) is a string of several thousand characters apparently
'describing' the picture or sound in code.
Unfortunately, I couldn't get AS to accept +data PICT; as a comparison
value.
However, if you're interested in a workaround, you could use an FMP
calculation field to interpret the contents of a container field for you.
For example, you might try a solution along these lines (I've assumed that
the field containing the relevant images is called "picture"):
In database 1, create a calculation field called (say) "picExists" - with
the following formula:
If(IsEmpty(picture); "false"; "true")
Now in your script, enter something like:
tell application "FileMaker Pro"
show (every record of database 1 whose cell "picExists" = false)
--do something with the records
end tell
Not a perfect solution but - if all else fails - it might help.
Kai
--
**********************************
Kai Edwards Creative Resources
1 Compton Avenue Brighton UK
Telephone +44 (0)1273 326810
**********************************