[dba-VB] Just a Christmas quickie Using Not Instead of = False

Max Wanadoo max.wanadoo at gmail.com
Thu Dec 24 07:07:18 CST 2009


Or you could do this (which I prefer)

If not rst.eof then
Do my stuff
Else
Msgbox "who nicked my records"
Endif

Ps. Who is the programmer?  You, or the Project Manager?

Max


-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Andy Lacey
Sent: 24 December 2009 12:59
To: 'Discussion concerning Visual Basic and related programming issues.'
Subject: Re: [dba-VB] Just a Christmas quickie Using Not Instead of = False

Hi Paul
Well I'll wait to be corrected but I reckon they're simply two syntactically
different ways of saying the same thing. They'd surely compile into the same
code. So it just comes down to preference of style and readability, i.e.
totally subjective

Andy 

-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Paul Hartland
Sent: 24 December 2009 12:09
To: VisualBasicList
Subject: [dba-VB] Just a Christmas quickie Using Not Instead of = False


To all,

I use a lot of recordsets, and to detect they actually contain something I
have always used the following:

If myrecordset.bof=false and myrecordset.eof=false then
    do my stuff here
Else
    msgbox "empty"
End If

However my project manager prefers:
 If not myrecordset.bof and not myrecordset.eof then
    do my stuff here
Else
    msgbox "empty"
End If

Is there actually a prefered way, or is one quicker than the other, or is
there an even better way to do this ?

Thanks in advance for any comments, and a very merry christmas & happy new
year to everyone.

-- 
Paul Hartland
paul.hartland at googlemail.com
_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
http://www.databaseadvisors.com



_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
http://www.databaseadvisors.com




More information about the dba-VB mailing list