![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Filemaker lets you format a field with a checkbox set or radio button set on a layout independently of the underlying data type. I always get confused about which data type to use. All I want is a binary yes/no variable. Currently I am using the following - A value list called 'Binary' with the values 'True', 'False' - A Text field - On the layout, a checkbox set using the 'Binary' value list. I never even use the 'False' checkbox. All I want is 'True' or blank. What's the proper Filemaker way? Thank you, Kevin P.S. I have posted numerous questions on this board and wanted to say thank you to everyone who has written such excellent answers! |
#3
| |||
| |||
|
|
Filemaker lets you format a field with a checkbox set or radio button set on a layout independently of the underlying data type. I always get confused about which data type to use. All I want is a binary yes/no variable. Currently I am using the following - A value list called 'Binary' with the values 'True', 'False' - A Text field - On the layout, a checkbox set using the 'Binary' value list. I never even use the 'False' checkbox. All I want is 'True' or blank. What's the proper Filemaker way? Thank you, Kevin P.S. I have posted numerous questions on this board and wanted to say thank you to everyone who has written such excellent answers! |
#4
| |||
| |||
|
|
audleman (AT) quasika (DOT) net <audleman (AT) quasika (DOT) net> wrote: Filemaker lets you format a field with a checkbox set or radio button set on a layout independently of the underlying data type. I always get confused about which data type to use. All I want is a binary yes/no variable. Currently I am using the following - A value list called 'Binary' with the values 'True', 'False' - A Text field - On the layout, a checkbox set using the 'Binary' value list. I never even use the 'False' checkbox. All I want is 'True' or blank. What's the proper Filemaker way? Thank you, Kevin P.S. I have posted numerous questions on this board and wanted to say thank you to everyone who has written such excellent answers! I usually use a number field, set as a checkbox using a value list with only ONE value, "1". (oddly enough, I call this value list "Boolean") When the field is unfilled by any value, it is null. When you click the box, it goes to 1. After filling, when it is clicked again, it may be null or it may be 0 (usually null). If you want, you can auto-fill the field with a 0 value. You do need to be explicit in versions later than FM 5 to test for a positive value. In some situations FM sees nulls as 0, in others it doesn't. Cool things you can do with such a field: 1. Toggle it by making the field a set-field button (in 7) to set itself to Abs(sign(Fieldname)). This will toggle it back and forth. 2. Use it directly in calcs in place of If tests or Case tests - Qty * Price Each * (Tax Rate * fTaxable) where fTaxable is a number boolean such as we're discussing. Where an item is marked taxable, it calculates the line tax. Where it's 0 or null, the tax calc zeros out and isn't calculated. No Case tests. 3. In the number formatting for the field, you can give the users a text "True" or "False" readout using "Format Booleans As" and entering 7 characters or less for zero and non-zero results. The underlying data is still the number. (clever developers who need more than 7 characters just put another instance of the field on the layout and make the second instance the second 7 characters. Align carefully. Be aware cross-platform fonts may make it look funny) Lynn Allen -- Allen & Allen Semiotics www.semiotics.com FSA Associate Filemaker Design & Consulting |
#5
| |||
| |||
|
|
When I select the field, choose the "Format > button" menu, and "set field" with definition Abs ( Sign (database::fieldname) ) , the field value just will not change back to 0. Am I missing something? It seems like a very basic problem ... |
![]() |
| Thread Tools | |
| Display Modes | |
| |