JSW21
asked on
Expression is a value and therefore cannot be the target of an assignment vb.net
Public Structure _cache
Public loading As Boolean
End Structure
Public Class Server
Public _cache_List As New List(Of _cache)()
...
For index As Int16 = 0 To _cache_List.Count - 1
_cache_List(index).loading = false '--> error
Next
"Expression is a value and therefore cannot be the target of an assignment "
what was wrong in the code above?
Public loading As Boolean
End Structure
Public Class Server
Public _cache_List As New List(Of _cache)()
...
For index As Int16 = 0 To _cache_List.Count - 1
_cache_List(index).loading
Next
"Expression is a value and therefore cannot be the target of an assignment "
what was wrong in the code above?
ASKER
Hi there
So I change the Structure into Class and it works.
I didnt know using structure will have different from class.
Do you think i am doing the right thing.
So I change the Structure into Class and it works.
I didnt know using structure will have different from class.
Do you think i am doing the right thing.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I will need to use class as I need to modify its values.
You will have to declare a variable to hold a direct reference to the item and assign through that:
Open in new window