오늘 첨 리스트 뷰를 써보려 하는데 잘 안되네여
1|2001/10/19|BABO|ANGEL|
이런 데이터를 잘라서
-----------------------
DATE | TYPE | NAME |
-----------------------
2001/..|BABO |ANGEL |
------------------------
.....
이런 모양으로 만들려고 합니다.
아래 코드를 실행시켰더니,
으이궁..
-----------------------
DATE | TYPE | NAME |
-----------------------
| 2001/..| |
BABO
ANGEL
------------------------
.....
이렇게 나타나네여.. 왜 그런거져.. ? ㅜ.ㅠ
주르륵...
procedure TForm1.ShowLogList(fname : String);
var
F : TextFile;
temp : String;
buf : String;
begin
AssignFile(F, fname);
Reset(F);
while not Eof(F) do begin
readln(F, Buf);
temp := Copy(Buf, 1, Pos('|', Buf)-1); delete(Buf, 1, 2);
if strToInt(temp) = 1 then
begin
temp := Copy(Buf, 1, Pos('|', Buf)-1);
delete(Buf, 1, Pos('|', Buf)-1); delete(Buf, 1, 1);
showmessage(temp);
ListView1.Items.Add.SubItems.Add(temp);
temp := Copy(Buf, 1, Pos('|', Buf)-1);
delete(Buf, 1, Pos('|', Buf)-1); delete(Buf, 1, 1);
ListView1.Items.Add.SubItems.Add(temp);
end;
end;
CloseFile(F);
end;