Re: How to change the value of Boolean variable?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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"... ;)
.



Relevant Pages

  • Re: Import a text file using VB
    ... "Jack again" wrote in message ... >> the import wizard, clicked advanced and named the field. ... 0" to be displayed is code that falls through into the error-handler, ... error before attempting to display it. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Report Paging Problem
    ... The only real solution is to avoid using these events, ... Allen Browne - Microsoft MVP. ... display, the footer will display page 4 of 4 on the blank page and ...
    (comp.databases.ms-access)
  • Re: SQL "NOT IN" doesnt function as expected (refresh)
    ... The unfortunate fact is that what is displayed in datasheet view of a query is not what is stored if you are using a field that uses the lookup feature. ... That's why most of us avoid using the lookup field. ... On forms you can use a combobox to display one value while actually storing another value. ... implementation of the form is -supposed- to be independant of the underlying storage, otherwise it makes a mockery of the SQL standard. ...
    (microsoft.public.access.queries)
  • Re: amc-jack and ol grandma
    ... picture of "Kendall's mother and Spike's father kissing". ... Jack was going to say the "G" word!! ... avoid using the G word in any form. ... ick ick ick ...
    (rec.arts.tv.soaps.abc)
  • Re: Low-Carb Diets
    ... a little ironique but not exactly attacking anyone. ... Why not just answer his question and avoid the whole ... In one short succinct paragraph you've managed to display ...
    (alt.support.diabetes)