Re: How to change the value of Boolean variable?
- From: Duane Bozarth <dpbozarth@xxxxxxxxxxxx>
- Date: Sun, 23 Oct 2005 13:12:55 -0500
Jack wrote:
>
> I would like to make my code as much as possible optimal and avoid
> introducing new variables if not necessary.
> As far as I see I have 2 choices:
> 1. Do as you advise and add one more variable and a couple code lines to my
> code
> 2. Coerce vbasic to convert datatype for me.
> Which one is less evil?
....
Why not save the Boolean variable as a Boolean value? Why use a string
representation instead of logical? To me that would be the "optimal"
solution.
If you want to display "True/False" to a user, I'd write the display
code to do that function but wouldn't use a character variable as the
underlying variable.
VB has defined keywords True and False which are recognized as the
accepted VB values for logicals-- -1 and 0, respectively.
Use them and not a string representation of "True" or "False" is my
recommendation of which path is "less evil"... ;)
.
- References:
- How to change the value of Boolean variable?
- From: Jack
- Re: How to change the value of Boolean variable?
- From: Veign
- Re: How to change the value of Boolean variable?
- From: Jack
- Re: How to change the value of Boolean variable?
- From: Veign
- How to change the value of Boolean variable?
- Prev by Date: Re: Errors
- Next by Date: Re: Outlook Automation Problem
- Previous by thread: Re: How to change the value of Boolean variable?
- Next by thread: Re: How to change the value of Boolean variable?
- Index(es):
Relevant Pages
|