How do I add all contents in a written file to a DListView?
2 replies, posted
As the title says, "How do I add all contents in a written file to a DListView?". I don't know how to do this, help would be appreciated. I've tried doing this before, and it just changes everything in the file in to 1 line.
For example, if a file contains:
[lua]
bob
is
cool
[/lua]
I want 1 line in a DListView for each line in the file.
file.Read() + string.Explode(), then DListView:AddLine() ?
[QUOTE=jimbodude;31717209]file.Read() + string.Explode(), then DListView:AddLine() ?[/QUOTE]
To clear this up,
[lua]
for _,v in pairs(string.Explode("\n",file.Read("bobisgay.txt"))) do listview:AddLine(v) end
eg.
for _,v in pairs(string.Explode("\r\n",file.Read("bobisgay.txt"))) do listview:AddLine(v) end
[/lua]
Sorry, you need to Log In to post a reply to this thread.