Creative Single Checkboxes

For the new user to FileMaker, it seems so easy to simply create a field, make a value list containing "Yes" and "No" and set the field format to Checkboxes.

It sounds so simple right?

Well, this seemingly simple desire tends to trick more new developers than I'd like. After receiving an email about this very goal, I decided to create a video about how I approach single checkboxes.

In the past, I've created videos about temporary checkboxes using just global variables, but I figured I should elaborate on the data storage of the checkbox and how you can creatively display a checkbox when you opt not to use graphics.

I should mention, however, because of the font differences between Windows and Macintosh, this solution isn't as ideal as graphics. Especially, when designing for cross-platform, primarily because of the rendering differences between the two. But, when used for FileMaker Go on iPad or iPhone, or limited to one specific platform, this solution is quite ideal!

AttachmentSize
CreativeSingleCheckboxes.zip58.84 KB

Comments

Why not make your Set Field the following…
not Technique::Check

It's a little more straight-forward than that crazy and confusing guy named "Xor." :)

In fact, I've even seen this

not GetAsBoolean ( Table::field )

just to be sure the field is treated as a bool value and to be more indicative of what is going on.

I've even created simple custom functions in some solutions when there are a lot of switches because reading

ToggleBoolean ( Table::field )

Is highly readable! As I mentioned in the video, there are many different ways to switch a bit.

My personal use of "True xor" comes from habit in terms of how I read my own code. I tend to be a "negative" coder in terms of how I use logic. I'll typically choose to use "If ( not IsEmpty ( field ) ; True ; False )" as opposed to "If ( IsEmpty ( field ) ; False ; True )".

This means my code has a lot more "not"s within it. Being able to pick out the toggle is very easy because of the use of the "xor" - since it tends to be infrequently used. This one just boils down to preference, as I don't know that you can performance test a user invoked boolean switch. ;)

-- Matt Petrowsky - ISO FileMaker Magazine Editor