473,322 Members | 1,504 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Really lost, need some input or an example.

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
Jul 19 '05 #1
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

Jul 19 '05 #2
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


Jul 19 '05 #3
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



Jul 19 '05 #4
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
>
>



Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
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...
72
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...
131
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...
3
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...
1
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...
12
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."...
1
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...
1
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...
0
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...
0
isladogs
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...
1
isladogs
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...
0
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...
1
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...
1
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....
0
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
0
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...
0
isladogs
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.