By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,962 Members | 1,791 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,962 IT Pros & Developers. It's quick & easy.

Semantics for elimitating double-negative conditionals

P: n/a
I've been fighting with this issue for a long time. Let's say I want to do
something in a procedure only if something is not Null, not Empty, not
Nothing, not Missing, or not EOF. The conditional is always ugly. If there's
an Else condition, you can often reverse the condition to eliminate the
double-negative, but that can mean putting the If and Else parts in a less
logical order.

I figured out a while back that the loop until EOF issue can be handled
exactly that way = Do Until rst.EOF, so that helps, but sometimes, I still end
up needing Not rst.EOF.

I've been trying for a long time to figure out a nomenclature for functions to
invert these conditions that are not simply including the word Not in the
function names, and I finally think I've worked out a 1/2 way decent
nomenclature. It's idiomatic and imperfect, but so is the existing
nomenclature I'm working from, so if this or something like it became a de
facto standard, we would all get used to seeing and using it...

Current Antonym
----------- ----------
IsEmpty IsAssigned
IsNull HasValue
Is Nothing Exists
IsMissing IsSupplied
rst.EOF BeforeEof(rst)
Len(...) = 0 HasChars(...) Synonym would be EmptyString(...)

Other nice derivatives:
FirstAssigned(Arg1, Arg2, ...)
FirstHasValue(Arg1, Arg2, ...)
FirstExists(Arg1, Arg2, ...)
FirstSupplied(Arg1, Arg2, ...)
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

"Steve Jorgensen" <no****@nospam.nospam> wrote in message
news:9l********************************@4ax.com...
I've been fighting with this issue for a long time. Let's say I want to do something in a procedure only if something is not Null, not Empty, not
Nothing, not Missing, or not EOF. The conditional is always ugly. If there's an Else condition, you can often reverse the condition to eliminate the
double-negative, but that can mean putting the If and Else parts in a less
logical order.

I figured out a while back that the loop until EOF issue can be handled
exactly that way = Do Until rst.EOF, so that helps, but sometimes, I still end up needing Not rst.EOF.

I've been trying for a long time to figure out a nomenclature for functions to invert these conditions that are not simply including the word Not in the
function names, and I finally think I've worked out a 1/2 way decent
nomenclature. It's idiomatic and imperfect, but so is the existing
nomenclature I'm working from, so if this or something like it became a de
facto standard, we would all get used to seeing and using it...

Current Antonym
----------- ----------
IsEmpty IsAssigned
IsNull HasValue
Is Nothing Exists
IsMissing IsSupplied
rst.EOF BeforeEof(rst)
Len(...) = 0 HasChars(...) Synonym would be EmptyString(...)

Other nice derivatives:
FirstAssigned(Arg1, Arg2, ...)
FirstHasValue(Arg1, Arg2, ...)
FirstExists(Arg1, Arg2, ...)
FirstSupplied(Arg1, Arg2, ...)


["Steve Jorgensen" is a charter member of Access Morons. When he is not
writing brilliant essays, he spends his time promoting the benefits of
medical marijuana.]
Nov 13 '05 #2

P: n/a
On Wed, 15 Sep 2004 15:46:38 GMT, Steve Jorgensen <no****@nospam.nospam>
wrote:

....

I've been trying for a long time to figure out a nomenclature for functions to
invert these conditions that are not simply including the word Not in the
function names, and I finally think I've worked out a 1/2 way decent
nomenclature. It's idiomatic and imperfect, but so is the existing
nomenclature I'm working from, so if this or something like it became a de
facto standard, we would all get used to seeing and using it...

Current Antonym
----------- ---------- ....Len(...) = 0 HasChars(...) Synonym would be EmptyString(...)


I'm now thinking HasText is preferable to HasChars
Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.