PC Review


Reply
Thread Tools Rate Thread

can't get value from xml

 
 
Supra
Guest
Posts: n/a
 
      1st Aug 2004
how do i get value from xml file to checkbox1.checked ( 1 or 0) .

i stored value to xml:
rw.WriteConfigInfo("UserModes", "InvisibleOnServer",
CStr(chkInvisible.CheckState), "PirateChat.xml")

get value from xml and store in checkbox1.checked . but i couldn't get
value from xml:

'load user modes
Dim szInvisible As Collection =
clsReader.GetConfigInfo("PirateChat", "InvisibleOnServer", " ",
"PirateChat.xml")
Dim getInvisible As String
For Each getInvisible In szInvisible
chkInvisible.Checked = Val(getInvisible)
Debug.WriteLine("state :" & Val(getInvisible))
Next

all i got 0 value.

regards

 
Reply With Quote
 
 
 
 
Supra
Guest
Posts: n/a
 
      1st Aug 2004
this is what i got from xml file :
<UserModes>
<InvisibleOnServer>1</InvisibleOnServer>
<ReceiveServerMsg>1</ReceiveServerMsg>
<Wallop>1</Wallop>
</UserModes>

Supra wrote:

> how do i get value from xml file to checkbox1.checked ( 1 or 0) .
>
> i stored value to xml:
> rw.WriteConfigInfo("UserModes", "InvisibleOnServer",
> CStr(chkInvisible.CheckState), "PirateChat.xml")
>
> get value from xml and store in checkbox1.checked . but i couldn't get
> value from xml:
>
> 'load user modes
> Dim szInvisible As Collection =
> clsReader.GetConfigInfo("PirateChat", "InvisibleOnServer", " ",
> "PirateChat.xml")
> Dim getInvisible As String
> For Each getInvisible In szInvisible
> chkInvisible.Checked = Val(getInvisible)
> Debug.WriteLine("state :" & Val(getInvisible))
> Next
>
> all i got 0 value.
>
> regards
>


 
Reply With Quote
 
Chris Dunaway
Guest
Posts: n/a
 
      2nd Aug 2004
On Sun, 01 Aug 2004 11:36:59 GMT, Supra wrote:

> how do i get value from xml file to checkbox1.checked ( 1 or 0) .
>
> i stored value to xml:
> rw.WriteConfigInfo("UserModes", "InvisibleOnServer",
> CStr(chkInvisible.CheckState), "PirateChat.xml")
>
> get value from xml and store in checkbox1.checked . but i couldn't get
> value from xml:
>
> 'load user modes
> Dim szInvisible As Collection =
> clsReader.GetConfigInfo("PirateChat", "InvisibleOnServer", " ",
> "PirateChat.xml")
> Dim getInvisible As String
> For Each getInvisible In szInvisible
> chkInvisible.Checked = Val(getInvisible)
> Debug.WriteLine("state :" & Val(getInvisible))
> Next
>
> all i got 0 value.
>
> regards


You could do this:

chkInvisible.Checked = (Val(getInvisible) = 1)

If Val(getInvisible) is 0 then the condition will evaluate at false
--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
 
Reply With Quote
 
Supra
Guest
Posts: n/a
 
      3rd Aug 2004
i tried this b4. but in debug i can see value return zero insterad of 1

Chris Dunaway wrote:

>On Sun, 01 Aug 2004 11:36:59 GMT, Supra wrote:
>
>
>
>>how do i get value from xml file to checkbox1.checked ( 1 or 0) .
>>
>>i stored value to xml:
>> rw.WriteConfigInfo("UserModes", "InvisibleOnServer",
>>CStr(chkInvisible.CheckState), "PirateChat.xml")
>>
>>get value from xml and store in checkbox1.checked . but i couldn't get
>>value from xml:
>>
>> 'load user modes
>> Dim szInvisible As Collection =
>>clsReader.GetConfigInfo("PirateChat", "InvisibleOnServer", " ",
>>"PirateChat.xml")
>> Dim getInvisible As String
>> For Each getInvisible In szInvisible
>> chkInvisible.Checked = Val(getInvisible)
>> Debug.WriteLine("state :" & Val(getInvisible))
>> Next
>>
>>all i got 0 value.
>>
>>regards
>>
>>

>
>You could do this:
>
>chkInvisible.Checked = (Val(getInvisible) = 1)
>
>If Val(getInvisible) is 0 then the condition will evaluate at false
>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:16 PM.