Normal Topic Using a check box (Read 782 times)
NHUser
Full Member
***
Offline



Posts: 320
Location: Amherst, NH
Joined: Aug 2nd, 2010
Using a check box
Mar 18th, 2011 at 2:03pm
Print Post Print Post  
I'm using a check box to keep track of issues in a large database.  I want to verify the status of the check box and it's working well if the check box is checked (Yes) or unchecked (No), but how do I know if the check box is "undecided"?
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Using a check box
Reply #1 - Mar 18th, 2011 at 3:44pm
Print Post Print Post  
If a checkbox is undecided, @IsBlank will be True.

If @IsBlank(MyCheckbox)
{
       ... Do stuff
}
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Using a check box
Reply #2 - Mar 18th, 2011 at 4:37pm
Print Post Print Post  
Erika, wouldn't following also work...


If MyCheckbox <> 1 and MyCheckbox <> 0 then
{
      ... Do stuff
}

Just wondering!
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Using a check box
Reply #3 - Mar 18th, 2011 at 5:58pm
Print Post Print Post  
Bharat_Naik wrote on Mar 18th, 2011 at 4:37pm:
Erika, wouldn't following also work...


If MyCheckbox <> 1 and MyCheckbox <> 0 then
{
      ... Do stuff
}

Just wondering!


No, that won't work. SBasic will force the value to either 1 or 0, since it knows it's meant to be treated as a Boolean value.  Booleans do not have three states at code level.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Using a check box
Reply #4 - Mar 18th, 2011 at 6:05pm
Print Post Print Post  
Thanks Erika. I will keep this in mind.
  
Back to top
 
IP Logged