Hey,
I have this lovely class here
And I use it to get data from an xml with this function here, which was put together with the help from one of the community members on here and worked wonderfully in previous use.
So the Problem:
Once I get the data I try to update/change some of it using this for loop
But for some reason when I output it nothing is updated. I just get blanks, any reason why? :S
I have stepped through it and it does go through the if statement and I see it assign a value but nothing is changed when I output everything
I have this lovely class here
vb.net Code:
Public Class data Public Property Name As String Public Property Subname As String Public Property Type As String Public Property parameter() As String Public Property Summary As String End Class
And I use it to get data from an xml with this function here, which was put together with the help from one of the community members on here and worked wonderfully in previous use.
vb.net Code:
Public Function getdata(location As String) As IEnumerable(Of data) Dim doc = XDocument.Load(location) Dim newdata = From n In doc.<UserEx>.<CompletionList>.<member> Select New data With { .Name = n.@name, .Summary = n.<summary>.Value, .Type = .Name.Substring(0, 1) } Return newdata End Function
So the Problem:
Once I get the data I try to update/change some of it using this for loop
vb.net Code:
Dim newdata As IEnumerable(Of data) = getdata(location) Dim temp As Integer = 0 For Each line In newdata temp = line.Summary.IndexOf("(") If temp > 0 Then line.Subname = line.Summary.Substring(0, temp) 'If I output it here "Console.Writeline(line.subname)" then it is right but if I output after the for loop it does not work :\ End If Next
But for some reason when I output it nothing is updated. I just get blanks, any reason why? :S
I have stepped through it and it does go through the if statement and I see it assign a value but nothing is changed when I output everything