Re: Inputbox Question
- From: "DenBorg" <den_borg@xxxxxxxxx>
- Date: 8 Jul 2005 08:49:26 -0700
Bob Butler wrote:
>Does that mean you no longer believe the original advice?
>"Also, any place where "" *IS* needed, you should use the constant
>"vbNullString" instead."
No, the original point / advice still stands. Reread my comment
*carefully*, and you'll see that I said the context determines whether
vbNullString is an *appropriate replacement* for "". After you reread
it, you'll clearly see that I did not say that it was not appropriate
to replace the literal value with a constant.
IOW, the question is: "Is vbNullString an appropriate replacement for a
literal zero-length string? Or would a *different replacement* be
appropriate?" The context, IMO, would make that determination.
Never once did I even hint that it would ever be a bad idea to replace
literal zero-length strings with a constant.
Even you said that relying upon side effects may be a good choice in
rare occassions("... rarely a good choice ..."), though that would be
the exception and not the rule. And I would agree.
The question then becomes, is vbNullString an appropriate replacement
for zero-length literals when API calls are not involved, since VB sees
vbNullString and "" as essentially the same thing?
If you think "No", then your choices are to either create your own
constant and use that, or use the literal value and thus create bloat
in your program. The choice is yours.
FWIW, I don't see VB as a "dead language". Despite the fact that
Microsoft will not be enhancing and making newer versions of VB, it
will still be in use for a long time because of the thousands of
existing programs. VB is no more a "dead language" than is COBOL. The
cost of rewriting existing applications into a different language is
most often too high to be cost effective.
.
- Follow-Ups:
- Re: Inputbox Question
- From: Al Reid
- Re: Inputbox Question
- From: Rick Rothstein
- Re: Inputbox Question
- From: Bob Butler
- Re: Inputbox Question
- References:
- Inputbox Question
- From: A P
- Re: Inputbox Question
- From: Michael Cole
- Re: Inputbox Question
- From: DenBorg
- Re: Inputbox Question
- From: Bob Butler
- Re: Inputbox Question
- From: DenBorg
- Re: Inputbox Question
- From: Bob Butler
- Re: Inputbox Question
- From: DenBorg
- Re: Inputbox Question
- From: Bob Butler
- Inputbox Question
- Prev by Date: Re: Oleaut32
- Next by Date: Re: Input problem
- Previous by thread: Re: Inputbox Question
- Next by thread: Re: Inputbox Question
- Index(es):
Loading