Finding a string in a DListView with a variable, then changing it

Hi everyone. I’ve got my VoteMap going pretty well now, but now I’m stuck. I have the server file broadcasting to all of the clients that a vote has been made, at which point the clients then update their DListViews accordingly.

In my code here, maplist is the DListView. I create a local variable containing the GetLines function on it, then I run a for loop that should run through each line and figure out if it matches my map name, (which is the variable “decoded”.) So far it is no where finished, but I want to at least be able to get the names from the DListView first.

[lua]
print("Client receiving message, map is: “…decoded[“map”]…”, and votes is: "…decoded[“votes”])
local mlist = maplist:GetLines()
PrintTable(mlist)
for k,v in pairs(mlist) do
print(tostring(v:GetValue(2)))
–if v:GetValue(2) == decoded[“map”] then --If the value of the selected line in the second column is whatever map is, then…
if v:GetValue(2) then
v:SetValue(2, decoded[“votes”]) --Set dat dere line!
print(“Updated a line.”) --Just FTR…
end
end
[/lua]

What should be happening, is it should be printing the value. I get nothing. Not even nil. Just nothing.

Thanks for any help.

So have I stumped everyone? Does anyone have a different suggestion as to how I should go about this?

You didn’t say what was wrong, or at least, I didn’t see where you did.

Whoops lol :slight_smile: Well anyways, it always comes back blank. When it prints the GetValue.