Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

IF THEN, do nothing??

3,538 views
Skip to first unread message

Renee Fekete

unread,
Apr 4, 2002, 5:21:51 PM4/4/02
to
How do you write "do nothing" in an IF THEN ELSE ?? Here's my code, I'll
point out where I want to "do nothing".

For i=0 to 20
rsWishList.movefirst
rsWishList.Find "Part_Number = '" & Cstr(Request("TT" & i)) & "'"
if rsWishList.BOF or rsWishList.EOF then
*******DO NOTHING********
else
response.write(Request("TT" & i))
rsWishList("TT_Number") = Clng(i)
rsWishList.update
end if
next

For some reason, I can't get IF NOT to work, in which case I could reverse
things.

Thanks for the help ... again.


Kit

unread,
Apr 4, 2002, 5:34:39 PM4/4/02
to
There are two was to Accomplish this. Either use an empty fork:

if rsWishList.BOF or rsWishList.EOF then

else


response.write(Request("TT" & i))
rsWishList("TT_Number") = Clng(i)
rsWishList.update
end if


Or only use the fork that you're interested in:
if NOT (rsWishList.BOF or rsWishList.EOF) then


response.write(Request("TT" & i))
rsWishList("TT_Number") = Clng(i)
rsWishList.update
end if

-K

"Renee Fekete" <m...@nospam.com> wrote in message
news:uMz3kcC3BHA.2156@tkmsftngp07...

Renee Fekete

unread,
Apr 4, 2002, 5:36:14 PM4/4/02
to
Thanks, Kit. I couldn't figure out why If NOT wasn't work - again, missing
those paren. Sigh!

"Kit" <k...@smallfoxx.comnospam> wrote in message
news:eR#G6iC3BHA.2228@tkmsftngp07...

Torgeir Bakken

unread,
Apr 4, 2002, 5:39:18 PM4/4/02
to
Renee Fekete wrote:

Not should work, like this:

if not(rsWishList.BOF or rsWishList.EOF) then


response.write(Request("TT" & i))
rsWishList("TT_Number") = Clng(i)
rsWishList.update
end if


If not ;-)

if rsWishList.BOF or rsWishList.EOF then

else
response.write(Request("TT" & i))

end if

- or -

if rsWishList.BOF or rsWishList.EOF then

' do nothing


else
response.write(Request("TT" & i))

end if

--
torgeir


Dr.X

unread,
Apr 4, 2002, 5:47:02 PM4/4/02
to
try just commenting out the do nothing line with an apostrophe.
Like:

' do nothing

--
Dr.X


"Renee Fekete" <m...@nospam.com> wrote in message
news:uMz3kcC3BHA.2156@tkmsftngp07...

chris

unread,
Apr 4, 2002, 6:39:28 PM4/4/02
to
that's what i do. i don't like NOT's.

"Dr.X" <nospam...@rxp.com> wrote in message
news:GJ4r8.66585$y26.14...@typhoon.tampabay.rr.com...

Dean

unread,
Apr 4, 2002, 8:44:59 PM4/4/02
to
you could also do this to avoid using NOTs:

if rsWishList.BOF and rsWishList.EOF then


response.write(Request("TT" & i))
rsWishList("TT_Number") = Clng(i)
rsWishList.update
end if

Boolean lesson of the day:

not (A or B) = A and B

A or B = not (A and B)


Joseph Cotton

unread,
Apr 4, 2002, 9:16:52 PM4/4/02
to
In COBOL we had the NEXT SENTENCE phrase, but why mess up Visual Basic with
a good thing?

"chris" <cpa...@REMOVETHISPARTswatgear.com> wrote in message
news:eWugHHD3BHA.2736@tkmsftngp03...

Joseph Cotton

unread,
Apr 4, 2002, 9:22:43 PM4/4/02
to
Am I wrong in thinking
not (not A or not B) = A and B
?

Analysing the "> Boolean lesson of the day:"


>
> not (A or B) = A and B

if A is false and B is false, then
not (false or false) = false and false
not (false) = false
true = false
>
Sounds like Arafat logic.

Ken Kolda

unread,
Apr 4, 2002, 9:52:24 PM4/4/02
to
Corrected Boolean lesson of the day:

not (A or B) = (not A) and (not B)
A or B = not ((not A) and (not B))

The logic in your if statement is completely different from the logic that
was desired.

Ken


Dean <nob...@nowhere.com> wrote in message
news:a8ivis$s...@news.or.intel.com...

Mythran

unread,
Apr 5, 2002, 12:09:32 PM4/5/02
to
Remember, the BOF and EOF methods return a boolean value, instead of using
NOT's just check for them.

Example:

For i=0 to 20
rsWishList.movefirst
rsWishList.Find "Part_Number = '" & Cstr(Request("TT" & i)) & "'"

if rsWishList.BOF = False AND rsWishList.EOF = False then


response.write(Request("TT" & i))
rsWishList("TT_Number") = Clng(i)
rsWishList.update
end if
next

Mythran


"chris" <cpa...@REMOVETHISPARTswatgear.com> wrote in message
news:eWugHHD3BHA.2736@tkmsftngp03...

0 new messages