473,785 Members | 2,466 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1274
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").V alue)
B = CBool(rs.Fields .Item("PetB").V alue)
C = CBool(rs.Fields .Item("PetC").V alue)

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*****@megavi sion.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.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]" <myFirstNameATl ane34dotKOMM> wrote in message
news:ug******** ******@tk2msftn gp13.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").V alue)
B = CBool(rs.Fields .Item("PetB").V alue)
C = CBool(rs.Fields .Item("PetC").V alue)

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*****@megavi sion.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.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*****@megavi sion.com> wrote in message
news:Oi******** ******@tk2msftn gp13.phx.gbl...
Ray you are the man. The light blub is on and it makes sense. Thanks!

Still learning
Jeff
"Ray at <%=sLocation% > [MVP]" <myFirstNameATl ane34dotKOMM> wrote in message news:ug******** ******@tk2msftn gp13.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").V alue)
B = CBool(rs.Fields .Item("PetB").V alue)
C = CBool(rs.Fields .Item("PetC").V alue)

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*****@megavi sion.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.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]" <myFirstNameATl ane34dotKOMM> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Cool! :]

--

Ray at home
Microsoft ASP MVP
"Jeff Uchtman" <uc*****@megavi sion.com> wrote in message
news:Oi******** ******@tk2msftn gp13.phx.gbl...
Ray you are the man. The light blub is on and it makes sense. Thanks!

Still learning
Jeff
"Ray at <%=sLocation% > [MVP]" <myFirstNameATl ane34dotKOMM> wrote in message
news:ug******** ******@tk2msftn gp13.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").V alue)
B = CBool(rs.Fields .Item("PetB").V alue)
C = CBool(rs.Fields .Item("PetC").V alue)

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*****@megavi sion.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.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
8230
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 not - be able to use non-ASCII characters in strings and in Tk GUI button labels and GUI window titles and in raw_input data without Python returning wrong case in manipulated
72
5445
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 (dreamweaver and the like), they are all at the lowest level of programming (something like assembly as oposed to C++ etc.). These tools create "brain-dead" developers that constantly have to plough through tons of tags to do the simplest thing. ...
131
6230
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 portable C code - *not only* because, in a 'C sense', I
3
2020
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 teacher wants us to make the function and not use the library function. Here's the info: Write a C++ program that
1
3059
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 say, the form is bit longer and overflowed the page so the div has got vertical scroll bar. Now I am inserting data in the form. Inserted the 1st data and press tab to next input and insert the 2nd data. Now my cursor is in 2nd input type. Now...
12
1982
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." In Internet Explorer of course you get total rubbish. Anything from "page cannot be loaded" to "403 no permission." The thing is, I figured the first two at least could handle it, maybe
1
1404
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 integer input. After I compile the program, I need to modify the program again and replace the output statements with a call to a non-value returning function PrintAvg( ) that takes one parameter which is the calculated average. The function should...
1
2468
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 and its rate should come in the next two cells...it should take from the data base... it's my code........ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd" > <%@ page import="java.sql.*"...
0
10356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10161
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10098
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9958
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8986
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5390
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5523
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4058
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.