I simply use 1 and 0 for true and false.
If 1 same as If 5=5 same as If 7>4 same as If IsEmpty("")
If 0 same as If 5=4 same as If 7>9 same as If IsEmpty("x")
p.s. no, there is no Boolean data type for fields in FM, even though there's a GetAsBoolean function, which I find redundant.
there is a number field "formatting" that can show boolean labels and/or can be checkbox formatted or radio button formatted (using a value list).
I typically use the number field as checkbox (so it can be turned on/off - or true/false) with a value list of "1".
I change the size of the field so that the label of "1" is not shown, but place the name of the field or a text label to match your criteria.
I prefer the number '1', so that it can be counted and summed if needed.
just in case it's not clear from the above posts, use a Number field for Boolean needs.
FileMaker does have a True and False function. So you can use set field and set a Field to True or False and it will get a value of 1 or 0.
You can also put a field in to an if or case statement as part of a field definition or Set field command.
If( FieldName ; "Positive result"; "Negative result" )
The True and False functions also work as a script result.
If you try and type True or False into a number field it will not produce the desired result.
2 of 2 people found this helpful
Everything everyone else has said is exactly on point. Another thing I see sometimes is folks adding an auto-enter calculation that overwrites the field contents with GetAsBoolean ( Self ) to enforce the range of acceptable values. It isn't necessary, but it adds clarity sometimes.
Thank you David Moyer, beverly, Bruce Herbach, jbante for kindly responding to my query. I'm new to FileMaker and still getting up to speed. I don't fully understand any of these answers but I'm going to wait until I've studied FileMaker program more to ask any questions since then hopefully my questions would be more intelligent. In any event, thank you to all who took the time to answer and I hope and expect to return to this thread later with a little more understanding of FileMaker procedures.