dbTalk Databases Forums  

Help with containers

comp.databases.filemaker comp.databases.filemaker


Discuss Help with containers in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Iced Tea
 
Posts: n/a

Default Help with containers - 12-30-2009 , 08:25 AM






The DB that I have has a container field I use to store a picture and I am
trying to figure out how to show only the records that the container field
is empty (missing a picture). I am using FMP 8.5 Advanced.

Any help would be greatly appreciated!!!

Carl

Reply With Quote
  #2  
Old   
Christoph Kaufmann
 
Posts: n/a

Default Re: Help with containers - 12-30-2009 , 09:07 AM






Iced Tea <icedteas (AT) cox (DOT) net> wrote:

Quote:
The DB that I have has a container field I use to store a picture and I am
trying to figure out how to show only the records that the container field
is empty (missing a picture). I am using FMP 8.5 Advanced.
Try a calc field with the text function getastext () on the container
field, it should return various info about the picture. You can search
for whatever the result is if there's nothing in the container.

--
http://clk.ch

Reply With Quote
  #3  
Old   
Your Name
 
Posts: n/a

Default Re: Help with containers - 12-30-2009 , 02:03 PM



"Iced Tea" <icedteas (AT) cox (DOT) net> wrote

Quote:
The DB that I have has a container field I use to store a picture and I am
trying to figure out how to show only the records that the container field
is empty (missing a picture). I am using FMP 8.5 Advanced.

Any help would be greatly appreciated!!!
Create a new Calculation Field to 'flag' the empty container fields, and
then you can preform a Find on that (if the Find is performed by a script,
the the new Calculation Field doesn't need to be on any layout confusing
users).
e.g.
ContainerIsEmpty Calculation, Text Result, Unstored
= If (ContainerField = ""; "Is Empty"; "Not Empty")

or ContainerIsEmpty Calculation, Text Result, Unstored
= If (IsEmpty(ContainerField); "Is Empty"; "Not Empty")

Neither of these of course will find records where the Container Field has a
'blank' image (i.e. an image that is completely the same colour as the
background) - that would be impossible for FileMaker to do, unless you're
using images of a fixed size / resolution / colour depth.

Helpfull Harry )

Reply With Quote
  #4  
Old   
105
 
Posts: n/a

Default Re: Help with containers - 12-30-2009 , 06:38 PM



On 31/12/09 1:37 AM, Christoph Kaufmann wrote:
Quote:
Iced Tea<icedteas (AT) cox (DOT) net> wrote:

The DB that I have has a container field I use to store a picture and I am
trying to figure out how to show only the records that the container field
is empty (missing a picture). I am using FMP 8.5 Advanced.

Try a calc field with the text function getastext () on the container
field, it should return various info about the picture. You can search
for whatever the result is if there's nothing in the container.

the result of GetAsText varies depending on whether the image was
embedded or referenced (referenced returns the file path as well)...


example: embedded
costabrava2.gif


example referenced
size:240,220
image:images/costabrava2.gif
imagemac:/Cortex/Users/cortical/Desktop/images/costabrava2.gif

Assuming that there were no deviations from this in FM 8.5



as for the calc and the blank image issue, an insert is an insert, the
image content is irrelevant is it not. (think Mr. Ed, a horse is a
horse, of course of course...)


Consider using a numeric result for the IsEmpty calc evaluation;
c_flag_image = If( IsEmpty( image) ; 0; 1)

or even better, and auto enter calc ( can't recall if fm8.5 had aec)
aec_flag_image = If( IsEmpty( image) ; 0; 1)

that way you can utilise a routine c_1 constant field as the left key
for grr to return the empty /not empty, plus in really large tables, it
will be (theoretically at least) faster



plus (again caveat ? 8.5 possible) , if you want a text flag on the
layout or portal row, you can define the number format as boolean and
return a yes/no visual result on the 0/1 number field

and if in fm10, you could use a conditional format to colour highlight
the flag field

Reply With Quote
  #5  
Old   
Your Name
 
Posts: n/a

Default Re: Help with containers - 12-30-2009 , 11:26 PM



"105" <cortical (AT) internode (DOT) on.net> wrote

Quote:
snip
Consider using a numeric result for the IsEmpty calc evaluation;
c_flag_image = If( IsEmpty( image) ; 0; 1)

or even better, and auto enter calc ( can't recall if fm8.5 had aec)
aec_flag_image = If( IsEmpty( image) ; 0; 1)
If you're only wanting a numeric 0 or 1 result, then you don't need the If
statement at all - the IsEmpty function will return the correct result by
itself.
i.e.
c_flag_image = IsEmpty(image)

Helpfull Harry )

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.