I am having trouble grasping this due to brain block or just lack of brain..
I and doing a CBool on 3 true or false. I need all 3 to answer true to
display. If one or more are false it equals false. I tried this but after
looking at it and reading some comment I agree its a statement not a
function:
<%
Dim A, B, C 'As Integer
Dim Check 'As Boolean
A = rs("PetA")
B = rs("PetB")
C = rs("PetC")
Check = CBool(A = B = C) ' Check is set to True.
%>
PetA, PetB, and PetC are my true and false triggered by a check box. Ray
made a great point in an earlier question stating the function needs to
follow:
True + True + True = True
True + True + False = False
True + False + False = False
False + False + False = False
I have found examples of CBool by 2 items and it makes sense, the third item
is driving me crazy. Any help or pointing to some example text would be
much appreciated.
Jeff 4 1247
If A, B, and C are integers and you want to treat them as booleans, can I
assume that any non-zero integer is true and 0 is false? (That would be the
norm.) Assuming that, if you need all A, B, and C to be true in order for
Check to be true, you can do:
A = CBool(rs.Fields.Item("PetA").Value)
B = CBool(rs.Fields.Item("PetB").Value)
C = CBool(rs.Fields.Item("PetC").Value)
Check = A And B And C
If A, B, OR C is false, Check will be false. If all three A, B, and C are
true, then only then will C be true.
--
Ray at home
Microsoft ASP MVP
"Jeff Uchtman" <uc*****@megavision.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl... I am having trouble grasping this due to brain block or just lack of
brain.. I and doing a CBool on 3 true or false. I need all 3 to answer true to display. If one or more are false it equals false. I tried this but
after looking at it and reading some comment I agree its a statement not a function:
<% Dim A, B, C 'As Integer Dim Check 'As Boolean A = rs("PetA") B = rs("PetB") C = rs("PetC") Check = CBool(A = B = C) ' Check is set to True. %>
PetA, PetB, and PetC are my true and false triggered by a check box. Ray made a great point in an earlier question stating the function needs to follow: True + True + True = True True + True + False = False True + False + False = False False + False + False = False I have found examples of CBool by 2 items and it makes sense, the third
item is driving me crazy. Any help or pointing to some example text would be much appreciated.
Jeff
Ray you are the man. The light blub is on and it makes sense. Thanks!
Still learning
Jeff
"Ray at <%=sLocation%> [MVP]" <myFirstNameATlane34dotKOMM> wrote in message
news:ug**************@tk2msftngp13.phx.gbl... If A, B, and C are integers and you want to treat them as booleans, can I assume that any non-zero integer is true and 0 is false? (That would be
the norm.) Assuming that, if you need all A, B, and C to be true in order for Check to be true, you can do:
A = CBool(rs.Fields.Item("PetA").Value) B = CBool(rs.Fields.Item("PetB").Value) C = CBool(rs.Fields.Item("PetC").Value)
Check = A And B And C
If A, B, OR C is false, Check will be false. If all three A, B, and C are true, then only then will C be true.
--
Ray at home Microsoft ASP MVP
"Jeff Uchtman" <uc*****@megavision.com> wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl... I am having trouble grasping this due to brain block or just lack of brain.. I and doing a CBool on 3 true or false. I need all 3 to answer true to display. If one or more are false it equals false. I tried this but after looking at it and reading some comment I agree its a statement not a function:
<% Dim A, B, C 'As Integer Dim Check 'As Boolean A = rs("PetA") B = rs("PetB") C = rs("PetC") Check = CBool(A = B = C) ' Check is set to True. %>
PetA, PetB, and PetC are my true and false triggered by a check box.
Ray made a great point in an earlier question stating the function needs to follow: True + True + True = True True + True + False = False True + False + False = False False + False + False = False I have found examples of CBool by 2 items and it makes sense, the third item is driving me crazy. Any help or pointing to some example text would be much appreciated.
Jeff
Cool! :]
--
Ray at home
Microsoft ASP MVP
"Jeff Uchtman" <uc*****@megavision.com> wrote in message
news:Oi**************@tk2msftngp13.phx.gbl... Ray you are the man. The light blub is on and it makes sense. Thanks!
Still learning Jeff
"Ray at <%=sLocation%> [MVP]" <myFirstNameATlane34dotKOMM> wrote in
message news:ug**************@tk2msftngp13.phx.gbl... If A, B, and C are integers and you want to treat them as booleans, can
I assume that any non-zero integer is true and 0 is false? (That would be the norm.) Assuming that, if you need all A, B, and C to be true in order
for Check to be true, you can do:
A = CBool(rs.Fields.Item("PetA").Value) B = CBool(rs.Fields.Item("PetB").Value) C = CBool(rs.Fields.Item("PetC").Value)
Check = A And B And C
If A, B, OR C is false, Check will be false. If all three A, B, and C
are true, then only then will C be true.
--
Ray at home Microsoft ASP MVP
"Jeff Uchtman" <uc*****@megavision.com> wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl... I am having trouble grasping this due to brain block or just lack of brain.. I and doing a CBool on 3 true or false. I need all 3 to answer true
to display. If one or more are false it equals false. I tried this but after looking at it and reading some comment I agree its a statement not a function:
<% Dim A, B, C 'As Integer Dim Check 'As Boolean A = rs("PetA") B = rs("PetB") C = rs("PetC") Check = CBool(A = B = C) ' Check is set to True. %>
PetA, PetB, and PetC are my true and false triggered by a check box. Ray made a great point in an earlier question stating the function needs
to follow: True + True + True = True True + True + False = False True + False + False = False False + False + False = False I have found examples of CBool by 2 items and it makes sense, the
third item is driving me crazy. Any help or pointing to some example text would
be much appreciated.
Jeff
Works like a champ! Code is in place!
Thanks again!
Jeff
"Ray at <%=sLocation%> [MVP]" <myFirstNameATlane34dotKOMM> wrote in message
news:%2****************@tk2msftngp13.phx.gbl... Cool! :]
--
Ray at home Microsoft ASP MVP
"Jeff Uchtman" <uc*****@megavision.com> wrote in message news:Oi**************@tk2msftngp13.phx.gbl... Ray you are the man. The light blub is on and it makes sense. Thanks!
Still learning Jeff
"Ray at <%=sLocation%> [MVP]" <myFirstNameATlane34dotKOMM> wrote in message news:ug**************@tk2msftngp13.phx.gbl... If A, B, and C are integers and you want to treat them as booleans,
can I assume that any non-zero integer is true and 0 is false? (That would
be the norm.) Assuming that, if you need all A, B, and C to be true in order for Check to be true, you can do:
A = CBool(rs.Fields.Item("PetA").Value) B = CBool(rs.Fields.Item("PetB").Value) C = CBool(rs.Fields.Item("PetC").Value)
Check = A And B And C
If A, B, OR C is false, Check will be false. If all three A, B, and C are true, then only then will C be true.
--
Ray at home Microsoft ASP MVP
"Jeff Uchtman" <uc*****@megavision.com> wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl... > I am having trouble grasping this due to brain block or just lack of brain.. > I and doing a CBool on 3 true or false. I need all 3 to answer true to > display. If one or more are false it equals false. I tried this
but after > looking at it and reading some comment I agree its a statement not a > function: > > <% > Dim A, B, C 'As Integer > Dim Check 'As Boolean > A = rs("PetA") > B = rs("PetB") > C = rs("PetC") > Check = CBool(A = B = C) ' Check is set to True. > %> > > PetA, PetB, and PetC are my true and false triggered by a check box.
Ray > made a great point in an earlier question stating the function needs
to > follow: > True + True + True = True > True + True + False = False > True + False + False = False > False + False + False = False > I have found examples of CBool by 2 items and it makes sense, the third item > is driving me crazy. Any help or pointing to some example text
would be > much appreciated. > > Jeff > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Mike Dee |
last post by:
A very very basic UTF-8 question that's driving me nuts:
If I have this in the beginning of my Python script in Linux:
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
should I - or should I...
|
by: Mel |
last post by:
Are we going backwards ? (please excuse my spelling...)
In my opinion an absolute YES !
Take a look at what we are doing ! we create TAGS, things like <H1> etc.
and although there are tools...
|
by: pemo |
last post by:
Is C really portable? And, apologies, but this is possibly a little OT?
In c.l.c we often see 'not portable' comments, but I wonder just how
portable C apps really are.
I don't write...
|
by: c++dummy |
last post by:
I got this project for my class and I'm totally lost as to how to copy
the 1d array with the bone name into a 2d array using this supposed
strncpy function I'm supposed to create. I believe the...
|
by: kallol |
last post by:
Hi Everyone,
I have a form designed with a table and the table is inside a <div> (Required. Can’t get rid of it). The div has style “height: 100% and scrollable: auto”.
The issue: In IE, let...
|
by: -Lost |
last post by:
In Firefox and Safari for example, if I serve my XHTML documents as
application/xml or xhtml+xml they only display the top inch or so of the
document.
In Opera it says "object has been blocked."...
|
by: Cage26 |
last post by:
First, I need to rewrite the program to incorporate functions. And there should be a value returning function that returns an int that the user entered. It will be called 5 times, once for each...
|
by: rakeshnair |
last post by:
i wrote a code in jsp to create dynamic table..the problem is i need data base connection when cursor moves from one cell to other...
eg...when i enter product id in the first cell, the product name...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| | |