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 | | | | re: Really lost, need some input or an example.
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" <uchtman@megavision.com> wrote in message
news:%23bsJwPh6DHA.1852@TK2MSFTNGP10.phx.gbl...[color=blue]
> I am having trouble grasping this due to brain block or just lack of[/color]
brain..[color=blue]
> 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[/color]
after[color=blue]
> 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[/color]
item[color=blue]
> is driving me crazy. Any help or pointing to some example text would be
> much appreciated.
>
> Jeff
>
>[/color] | | | | re: Really lost, need some input or an example.
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:uglluWh6DHA.3860@tk2msftngp13.phx.gbl...[color=blue]
> 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[/color]
the[color=blue]
> 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" <uchtman@megavision.com> wrote in message
> news:%23bsJwPh6DHA.1852@TK2MSFTNGP10.phx.gbl...[color=green]
> > I am having trouble grasping this due to brain block or just lack of[/color]
> brain..[color=green]
> > 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[/color]
> after[color=green]
> > 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.[/color][/color]
Ray[color=blue][color=green]
> > 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[/color]
> item[color=green]
> > is driving me crazy. Any help or pointing to some example text would be
> > much appreciated.
> >
> > Jeff
> >
> >[/color]
>
>[/color] | | | | re: Really lost, need some input or an example.
Cool! :]
--
Ray at home
Microsoft ASP MVP
"Jeff Uchtman" <uchtman@megavision.com> wrote in message
news:Oi3Cpah6DHA.2908@tk2msftngp13.phx.gbl...[color=blue]
> 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[/color]
message[color=blue]
> news:uglluWh6DHA.3860@tk2msftngp13.phx.gbl...[color=green]
> > If A, B, and C are integers and you want to treat them as booleans, can[/color][/color]
I[color=blue][color=green]
> > assume that any non-zero integer is true and 0 is false? (That would be[/color]
> the[color=green]
> > norm.) Assuming that, if you need all A, B, and C to be true in order[/color][/color]
for[color=blue][color=green]
> > 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[/color][/color]
are[color=blue][color=green]
> > true, then only then will C be true.
> >
> > --
> >
> > Ray at home
> > Microsoft ASP MVP
> >
> >
> > "Jeff Uchtman" <uchtman@megavision.com> wrote in message
> > news:%23bsJwPh6DHA.1852@TK2MSFTNGP10.phx.gbl...[color=darkred]
> > > I am having trouble grasping this due to brain block or just lack of[/color]
> > brain..[color=darkred]
> > > I and doing a CBool on 3 true or false. I need all 3 to answer true[/color][/color][/color]
to[color=blue][color=green][color=darkred]
> > > display. If one or more are false it equals false. I tried this but[/color]
> > after[color=darkred]
> > > 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.[/color][/color]
> Ray[color=green][color=darkred]
> > > made a great point in an earlier question stating the function needs[/color][/color][/color]
to[color=blue][color=green][color=darkred]
> > > 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[/color][/color][/color]
third[color=blue][color=green]
> > item[color=darkred]
> > > is driving me crazy. Any help or pointing to some example text would[/color][/color][/color]
be[color=blue][color=green][color=darkred]
> > > much appreciated.
> > >
> > > Jeff
> > >
> > >[/color]
> >
> >[/color]
>
>[/color] | | | | re: Really lost, need some input or an example.
Works like a champ! Code is in place!
Thanks again!
Jeff
"Ray at <%=sLocation%> [MVP]" <myFirstNameATlane34dotKOMM> wrote in message
news:%23hS9Qdh6DHA.3704@tk2msftngp13.phx.gbl...[color=blue]
> Cool! :]
>
> --
>
> Ray at home
> Microsoft ASP MVP
>
>
> "Jeff Uchtman" <uchtman@megavision.com> wrote in message
> news:Oi3Cpah6DHA.2908@tk2msftngp13.phx.gbl...[color=green]
> > 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[/color]
> message[color=green]
> > news:uglluWh6DHA.3860@tk2msftngp13.phx.gbl...[color=darkred]
> > > If A, B, and C are integers and you want to treat them as booleans,[/color][/color][/color]
can[color=blue]
> I[color=green][color=darkred]
> > > assume that any non-zero integer is true and 0 is false? (That would[/color][/color][/color]
be[color=blue][color=green]
> > the[color=darkred]
> > > norm.) Assuming that, if you need all A, B, and C to be true in order[/color][/color]
> for[color=green][color=darkred]
> > > 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[/color][/color]
> are[color=green][color=darkred]
> > > true, then only then will C be true.
> > >
> > > --
> > >
> > > Ray at home
> > > Microsoft ASP MVP
> > >
> > >
> > > "Jeff Uchtman" <uchtman@megavision.com> wrote in message
> > > news:%23bsJwPh6DHA.1852@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[/color][/color]
> to[color=green][color=darkred]
> > > > display. If one or more are false it equals false. I tried this[/color][/color][/color]
but[color=blue][color=green][color=darkred]
> > > 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.[/color]
> > Ray[color=darkred]
> > > > made a great point in an earlier question stating the function needs[/color][/color]
> to[color=green][color=darkred]
> > > > 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[/color][/color]
> third[color=green][color=darkred]
> > > item
> > > > is driving me crazy. Any help or pointing to some example text[/color][/color][/color]
would[color=blue]
> be[color=green][color=darkred]
> > > > much appreciated.
> > > >
> > > > Jeff
> > > >
> > > >
> > >
> > >[/color]
> >
> >[/color]
>
>[/color] |  | Similar ASP / Active Server Pages bytes | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,419 network members.
|