Hello, Phil. I'm assuming you have a series of container fields on the tab. If this is the case, you can use a calculation to add a radio button to the tab label by testing to see if any of the containers is empty. You don't need a script per se.
Just use the "Specify" button on the tab control screen to specify the calculation. It might look something like this:
"Digital Docs" & Case ( not IsEmpty ( containerField1 ) ; " " & Char ( 8226 ) ; not IsEmpty ( containerField2 ) ; " " & Char ( 8226 ) ; not IsEmpty ( containerField3 ) ; " " & Char ( 8226 ))
Char ( 8226 ) will produce a radio button symbol. If you're on the Mac, you can produce it with Opt-8. Don't know what the equivalent is on Windows, but Char ( 8226 ) will work either way. You can add as many legs to the Case statement as you need. (There are more sophisticated ways to do the concatenation, but this will work.)
Thanks Mike for the prompt reply,
I really like this method. Any ideas as to how I could set up a counter so I could keep track of the amount of pictures?
Sure. One way would be to use a series of calculations like this:
not IsEmpty ( containerField1 ) + not IsEmpty ( containerField2 ) + not IsEmpty ( containerField3 )
This will give you a number equal to the number of container fields that are not empty. There are more sophisticated methods - the main weakness this one has it its dependence on hard-coding the fields into the calculation. But if you get to that point, you'll probably want to upgrade how the system is structured to make it more flexible anyway.
how I could set up a counter
not IsEmpty ( containerField1 ) + not IsEmpty ( containerField2 ) + not IsEmpty ( containerField3 ) […] There are more sophisticated methods
The obvious way is to use the function that does exactly that:
Count ( containerField1 ; containerField2 ; containerField3 )
Ugh. I never use Count ( ) this way, so didn't think of it. Thanks, Oliver.
And Phil, since Oliver reminded me of this, the original calculation would be better as:
"Digital Docs" & Case ( not IsEmpty ( Count ( containerField1 ; containerField2 ; containerField3 )) ; " " & Char ( 8226 ))
Much simpler and easier to maintain.
I hate having to correct you , but
Count ( containerField1 ; containerField2 ; containerField3 ) ;
" " & Char ( 8226 )
is even simpler and more to the (Boolean) point …
Yes, but we’re trying to use explicit coding. So mine isn’t “wrong” and in need of correction; it’s simply a different style. (IOW, now you’re splitting hairs.)
You could argue that
Count > 0
is better than
not IsEmpty ( Count )
and I might agree. But the implicit Boolean has been argued against on several occasions on this board (and other places) in favor of explicit coding.
(And since we’re dealing with someone who’s relatively new to FileMaker here, this discussion is probably not helping him much at this point.)
Yes, but we’re trying to use explicit coding. So mine isn’t “wrong” and in need of correction
You're right, it wasn't in need of correction – wrong choice of word.
But I didn't see any sign that says “explicit coding only” – regardless whether
the implicit Boolean has been argued against on several occasions on this board (and other places) in favor of explicit coding
And though I would agree with the use of Count ( something ) > 0, I think that
not IsEmpty ( Count ( something ) )
unnecessarily muddies the waters …
And since we’re dealing with someone who’s relatively new to FileMaker here, this discussion is probably not helping him much at this point.
Why can't we have us a nice little chat on the side? The OP can read it or ignore it.
Maybe because it unnecessarily muddies the waters?
There are certain things I think it's important for newbies to understand to avoid problems later. (Ex: Don't use repeating fields as a substitute for a related table.) But issues of coding style are probably left until later.
But since you asked, personally, I tend to agree with the "explicit coding" side of that debate, especially when dealing with newbies. The implicit Boolean conceals things too much for most newbies. At least in my experience.
You both seems forgetting that Count(field;field) never be Empty although both fields are empty, it returns 0.
Yes, I realized that later. Count > 0 should be used for explicit coding, just plain Count for implicit. Thanks for contributing.