Re: How to change the value of Boolean variable?
- From: "Veign" <NOSPAMinveign@xxxxxxxxx>
- Date: Sun, 23 Oct 2005 13:27:20 -0400
There is no correct or perfect way but in this case I would probably just
store a Bit value to determine if Bold is set.
In the ini file I would store:
ButtonsFontType = 0
--or--
ButtonsFontType = 1
Then evaluate that value to set the bold of your command buttons.
--
Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
Veign's Blog
http://www.veign.com/blog
--
"Jack" <replyto@newsgroup> wrote in message
news:OiBe$X$1FHA.3276@xxxxxxxxxxxxxxxxxxxxxxx
>I am just not sure how to store in ini file (and later to read it from) the
>preferences which are Boolean type.
> For example I want to save in ini file .FontBold
> 1-st question: Is this correct?
> 'ButtonsFontType
> U = WritePrivateProfileString(lpAppName, "ButtonsFontType",
> CmdS(1).FontBold, lpFileName)
>
> Second question:
> When loading (reading) that 'ButtonsFontType preference:
> X = GetPrivateProfileString(lpAppName, "ButtonsFontType", lpDefault,
> sName, Len(sName), lpFileName)
> If X > 0 Then myVar = Left(sName, X) Else myVar = False
>
> Is that correct way of programming or it needs some corrections?
> Thanks,
> Jack
>
> "Veign" <NOSPAMinveign@xxxxxxxxx> wrote in message
> news:OIkFcJ$1FHA.3256@xxxxxxxxxxxxxxxxxxxxxxx
>> myVar = CBool(lpString)
>>
>> Not sure what your exact question is. You should explicitly cast teh
>> variable to a differnt type - in your case string to boolean. In your
>> case VB is handling this for you.
>>
>> Be aware that "True" is not true in all languages.
>>
>> --
>> Chris Hanscom - Microsoft MVP (VB)
>> Veign's Resource Center
>> http://www.veign.com/vrc_main.asp
>> Veign's Blog
>> http://www.veign.com/blog
>> --
>>
>>
>> "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
>>>
>>
>>
>
>
.
- 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
- How to change the value of Boolean variable?
- Prev by Date: Outlook Automation Problem
- 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
|