dbTalk Databases Forums  

Boolean

comp.databases.filemaker comp.databases.filemaker


Discuss Boolean in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ph. Verone
 
Posts: n/a

Default Boolean - 10-31-2010 , 08:08 AM






Dear All,

I have put a couple of simple databases together in Filemaker 10 Pro.
However, I am currently breaking my head over what I think is a rather
simple problem.

I want to add a simple Boolean Field in Filemaker.

Answer Rec'd: Yes / No


For this I have created a 'Value List' called Boolean with two values
in it: 1) Yes, 2) No.

Secondly, I flag the properties that this should be a unique value.


In the Layout, I have created Tick Boxes for Yes and No.


I was hoping that the user simply could toggle between Yes and No,
however, Filemaker gives interrupting messages about the Unique value.

Can anybody point me to a good and simple method of setting the above up?

Thanks in advance.


VV

Reply With Quote
  #2  
Old   
 
Posts: n/a

Default Re: Boolean - 10-31-2010 , 10:03 AM






"Ph. Verone" <nospam (AT) gmail (DOT) com> wrote

Quote:
Dear All,

I have put a couple of simple databases together in Filemaker 10 Pro.
However, I am currently breaking my head over what I think is a rather
simple problem.

I want to add a simple Boolean Field in Filemaker.

Answer Rec'd: Yes / No


For this I have created a 'Value List' called Boolean with two values in
it: 1) Yes, 2) No.

Secondly, I flag the properties that this should be a unique value.


In the Layout, I have created Tick Boxes for Yes and No.


I was hoping that the user simply could toggle between Yes and No,
however, Filemaker gives interrupting messages about the Unique value.

Can anybody point me to a good and simple method of setting the above up?

Thanks in advance.


VV

Use radiobuttons instead of tick-boxes. You probably don't really want to
check for a unique value. The user already is limited to a yes or no through
the radiobuttons. Further you might re-think the name of the field. A
boolean value is a true or a false, also represented as a 1 or a 0, but not
a yes or a no. It might be very confusing when you are reworking your
solution (say after a year) and find a field that is called boolean, but
doesn't actually hold one.

keep well, Ursus

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

Default Re: Boolean - 10-31-2010 , 10:22 AM



Ph. Verone wrote:

Quote:
Secondly, I flag the properties that this should be a unique value.
That means that no two records must hold the same value. Uncheck this,
the value list test is fine.

You may want to test the condition

If ( field="Yes" ;...

which will work.

However, Filemaker is able to read the boolean field directly if you bow
to its language, which are, as Ursus said, 0 for false and 1 for true.

I make boolean fields number fields that can hold 0 and 1, and I use the
number format to display the words Yes and No. Unfortunately, this
doesn't work with radio buttoms, so I use drop down instead.
--
http://clk.ch

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

Default Re: Boolean - 10-31-2010 , 02:10 PM



<u> wrote

Quote:
"Ph. Verone" <nospam (AT) gmail (DOT) com> wrote in message
news:4ccd786f$0$5819$426a74cc (AT) news (DOT) free.fr...
Dear All,

I have put a couple of simple databases together in Filemaker 10 Pro.
However, I am currently breaking my head over what I think is a rather
simple problem.

I want to add a simple Boolean Field in Filemaker.
Answer Rec'd: Yes / No

For this I have created a 'Value List' called Boolean with two values in
it: 1) Yes, 2) No.

Secondly, I flag the properties that this should be a unique value.

In the Layout, I have created Tick Boxes for Yes and No.

I was hoping that the user simply could toggle between Yes and No,
however, Filemaker gives interrupting messages about the Unique value.

Can anybody point me to a good and simple method of setting the above
up?

Use radiobuttons instead of tick-boxes. You probably don't really want to
check for a unique value. The user already is limited to a yes or no
through
the radiobuttons. Further you might re-think the name of the field. A
boolean value is a true or a false, also represented as a 1 or a 0, but
not
a yes or a no. It might be very confusing when you are reworking your
solution (say after a year) and find a field that is called boolean, but
doesn't actually hold one.
Formatting the Field as Radio Buttons is right (or as Christoph said, you
can use Pop-up Menu or Pop-up List formatting too) ... but FileMaker is a
bit non-standard and it is possible to select multiple options even in any
Field format, including Radio Buttons. (

To get around this silliness and make sure the user only chooses a single
value you would have to set the Field's options to Validate by Calculation.
The Calculation can then check for only one value - there's a number of ways
to achieve that, but since FileMaker separates multiplevalues in a Field
using carriage returns, the easiest way is simply to check for carriage
return characters.
i.e.
Position(FieldName; "P"; 1; 1) = 0

where P is really the "reverse P" carriage return symbol.


BUT,
If you really want to use the Tick Box format, then you can achieve the same
result by putting invisible Buttons over the Field options so that when the
user clicks on an option it runs a Script to turn on that option and turn
off the other option. This way you also do not need Validation since the
user cannot ever choose more than one option.

Helpful Harry )

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

Default Re: Boolean - 10-31-2010 , 05:26 PM



On 1/11/10 12:38 AM, Ph. Verone wrote:
Quote:
Dear All,

I have put a couple of simple databases together in Filemaker 10 Pro.
However, I am currently breaking my head over what I think is a rather
simple problem.

I want to add a simple Boolean Field in Filemaker.

Answer Rec'd: Yes / No


For this I have created a 'Value List' called Boolean with two values in
it: 1) Yes, 2) No.

Secondly, I flag the properties that this should be a unique value.


In the Layout, I have created Tick Boxes for Yes and No.


I was hoping that the user simply could toggle between Yes and No,
however, Filemaker gives interrupting messages about the Unique value.

Can anybody point me to a good and simple method of setting the above up?

Thanks in advance.


VV

Add a button to the number field, define data formatting as Boolean. The
field can/should be an auto enter; whatever the default status should
be, this avoids nulls. The IsEmpty, is then arguably redundant, but a
fail safe. The Let structure provides portability, can copy for other
fieds and only chage the one (F) definition.




EDIT: edit_toggle_boolean
#
Set Field [ aTable::ae_field;
Let([
F= aTable::ae_field ];
Case(
IsEmpty ( F) ; 1;
F= 1; 0 ;
F= 0; 1; )
) ]
#
#
Commit Records/Requests
[ Skip data entry validation; No dialog ] Refresh Window
[ Flush cached join results ]


The script step can be wrapped in a conditional, which evaluates the
source, so you can have one script for multiple booleans

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

Default Re: Boolean - 10-31-2010 , 06:21 PM



In article <4ccdfb29$0$29895$c3e8da3$5496439d (AT) news (DOT) astraweb.com>, 105
<cortical (AT) internode (DOT) on.net> wrote:
Quote:
Add a button to the number field, define data formatting as Boolean. The
field can/should be an auto enter; whatever the default status should
be, this avoids nulls. The IsEmpty, is then arguably redundant, but a
fail safe. The Let structure provides portability, can copy for other
fieds and only chage the one (F) definition.

EDIT: edit_toggle_boolean
#
Set Field [ aTable::ae_field;
Let([
F= aTable::ae_field ];
Case(
IsEmpty ( F) ; 1;
F= 1; 0 ;
F= 0; 1; )
) ]
#
#
Commit Records/Requests
[ Skip data entry validation; No dialog ] Refresh Window
[ Flush cached join results ]


The script step can be wrapped in a conditional, which evaluates the
source, so you can have one script for multiple booleans
There's a more elegant, one command method of swapping a 0 and 1 boolean
value which someone else posted here a long time back ...

Set Field [BooleanField; Abs(BooleanField - 1)]


Helpful Harry )

Reply With Quote
  #7  
Old   
 
Posts: n/a

Default Re: Boolean - 11-01-2010 , 04:53 AM



Quote:
The script step can be wrapped in a conditional, which evaluates the
source, so you can have one script for multiple booleans

There's a more elegant, one command method of swapping a 0 and 1 boolean
value which someone else posted here a long time back ...

Set Field [BooleanField; Abs(BooleanField - 1)]


Helpful Harry )
or Set Field [BooleanField ; not booleanfield ]

Keep well, Ursus

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

Default Re: Boolean - 11-01-2010 , 06:09 PM



In article <eb67f$4cce9c15$53578ad3$1374 (AT) cache5 (DOT) tilbu1.nb.home.nl>, <u> wrote:
Quote:
The script step can be wrapped in a conditional, which evaluates the
source, so you can have one script for multiple booleans

There's a more elegant, one command method of swapping a 0 and 1 boolean
value which someone else posted here a long time back ...

Set Field [BooleanField; Abs(BooleanField - 1)]

or Set Field [BooleanField ; not booleanfield ]
Yep, that's another nice, short method.

Instead of using checkbox / radio button formatting, I often create my own
proper tick boxes. If you know the computer the database will be used on
has the Zapf Dingbats (or Wingdings) font, then luckily the tick replaces
the 3 or 4 number, so you can use the same method to turn the tick on and
off.
e.g.
Set Field [BooleanField; Abs(BooleanField - 1) * 4]
or
Set Field [BooleanField ; not(BooleanField) * 4]

and simply format the Field to use the Zapf Dingbat font.

Helpful Harry )

Reply With Quote
  #9  
Old   
Jens Rasmussen, Fimano, Denmark
 
Posts: n/a

Default Re: Boolean - 11-03-2010 , 02:10 PM



I use the simplest way, if possible. That involves one checkbox. It is
still called a "Checkbox set", though. If you buy that way of
presenting a boolean value, read on.

I always have a Value list, of type Custom, containing just the value
1. It is called "_Bool__c", but could just as well be called simply
Boolean. But remember, only one value. If I need to take care of null
values vs. zeros, I do this in other ways, but normally, it is not
necessary (both evaluate to false).

Like Christoph, I use number fields to store the actual values, Like
VAT, Billable, PaymentReceived etc. To display only the check box and
not the number 1, just make the field narrow (square).

In any case, while developing, you can put a second field next to the
one in question, and format it as a normal edit field. Then you know
what is going on. Remember to make the field high enough to see more
than one line.

If you use a Radio button set after all, you can prevent the
accidental shift-clicking that results in multiple values:
On the field select Options - Auto-Enter - Calculated value. Type:
GetValue ( Self ; ValueCount ( Self ) )
Clear "Do not replace existing value of field (if any)".
This trick ensures that only the last value gets into the field.

Reply With Quote
  #10  
Old   
Grip
 
Posts: n/a

Default Re: Boolean - 11-03-2010 , 08:54 PM



On Nov 1, 6:09Â*pm, your.n... (AT) isp (DOT) com (Your Name) wrote:
Quote:
In article <eb67f$4cce9c15$53578ad3$1... (AT) cache5 (DOT) tilbu1.nb.home.nl>, <u> wrote:

The script step can be wrapped in a conditional, which evaluates the
source, so you can have one script for multiple booleans

There's a more elegant, one command method of swapping a 0 and 1 boolean
value which someone else posted here a long time back ...

Â* Â* Set Field [BooleanField; Abs(BooleanField - 1)]

or Set Field [BooleanField ; not booleanfield ]

Yep, that's another nice, short method.

Instead of using checkbox / radio button formatting, I often create my own
proper tick boxes. If you know the computer the database will be used on
has the Zapf Dingbats (or Wingdings) font, then luckily the tick replaces
the 3 or 4 number, so you can use the same method to turn the tick on and
off.
e.g.
Â* Â* Â* Set Field [BooleanField; Abs(BooleanField - 1) * 4]
or
Â* Â* Â* Set Field [BooleanField ; not(BooleanField) * 4]

and simply format the Field to use the Zapf Dingbat font.

Helpful Harry Â*)
On Nov 1, 6:09Â*pm, your.n... (AT) isp (DOT) com (Your Name) wrote:
Quote:
In article <eb67f$4cce9c15$53578ad3$1... (AT) cache5 (DOT) tilbu1.nb.home.nl>, <u> wrote:

The script step can be wrapped in a conditional, which evaluates the
source, so you can have one script for multiple booleans

There's a more elegant, one command method of swapping a 0 and 1 boolean
value which someone else posted here a long time back ...

Â* Â* Set Field [BooleanField; Abs(BooleanField - 1)]

or Set Field [BooleanField ; not booleanfield ]

Yep, that's another nice, short method.

Instead of using checkbox / radio button formatting, I often create my own
proper tick boxes. If you know the computer the database will be used on
has the Zapf Dingbats (or Wingdings) font, then luckily the tick replaces
the 3 or 4 number, so you can use the same method to turn the tick on and
off.
e.g.
Â* Â* Â* Set Field [BooleanField; Abs(BooleanField - 1) * 4]
or
Â* Â* Â* Set Field [BooleanField ; not(BooleanField) * 4]

and simply format the Field to use the Zapf Dingbat font.

Helpful Harry Â*)
These days, I do away with showing the actual field at all. Just use
text box, button, and conditional formatting.

For example, the OP can have a simple text box "Answer Rec'd" with two
other text boxes, "Yes" and "No". Set the Yes/No boxes a script
setting the Boolean Field with conditional formatting to highlight the
chosen result.

If you're into checkboxes, make a box into a script and put an "x" or
a more commonly used font character, like the square root symbol which
is found in hundreds of fonts: √. That character is conditionally
formatted to only show when the Boolean field returns a 1. Not all
systems have the Zapf fonts.

G

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.