Re: How to change the value of Boolean variable?

Tech-Archive recommends: Speed Up your PC by fixing your registry




"Hal Rosser" <hmrosser@xxxxxxxxxxxxx> wrote in message
news:ZCP6f.2345$NJ.1987@xxxxxxxxxxxxxxxxxxxxxxxxx
>
> "Jack" <replyto@newsgroup> wrote in message
> news:e5jLtB$1FHA.3856@xxxxxxxxxxxxxxxxxxxxxxx
>> dim MyVar as Boolean
>> dim lpString as String
>>
>> lpString = "True"
>> myVar = lpString
>>
>> My vbasic5 dos not object that and assigns True value to myVar.
>>
>> Is this correct way, or it is wrong?
>> Your thoughts please,
>> Jack
>
> When you put quotes around the word True, you're making a String.
> Dim myVar as Boolean
> myVar = True
> (Just leave off the quotes)


You're missing the point of his question. <g>

--
Mike
Microsoft MVP Visual Basic


.



Relevant Pages

  • Re: Type Mismatch error
    ... You have dimensioned myVar as an array of strings. ... Dim myVar As String ... Dim rngFindResult As Range ...
    (microsoft.public.excel.programming)
  • Re: How to change the value of Boolean variable?
    ... > dim MyVar as Boolean ... > dim lpString as String ... means is that VB will gladly convert a value of one data type to another ...
    (microsoft.public.vb.general.discussion)
  • How to change the value of Boolean variable?
    ... dim MyVar as Boolean ... dim lpString as String ... My vbasic5 dos not object that and assigns True value to myVar. ...
    (microsoft.public.vb.general.discussion)
  • Re: How to change the value of Boolean variable?
    ... variable to a differnt type - in your case string to boolean. ... > dim MyVar as Boolean ... > dim lpString as String ...
    (microsoft.public.vb.general.discussion)
  • Re: boolean variable?
    ... Dim myVar as boolean ... This macro calls to another function, which only requires an input if the ...
    (microsoft.public.excel.programming)