| 11 |
ComboBox1: TComboBox; |
ComboBox1: TComboBox; |
| 12 |
Label1: TLabel; |
Label1: TLabel; |
| 13 |
Button1: TButton; |
Button1: TButton; |
| 14 |
|
BitBtn2: TBitBtn; |
| 15 |
BitBtn1: TBitBtn; |
BitBtn1: TBitBtn; |
| 16 |
procedure Button1Click(Sender: TObject); |
procedure Button1Click(Sender: TObject); |
| 17 |
|
procedure FormCreate(Sender: TObject); |
| 18 |
|
procedure FormDestroy(Sender: TObject); |
| 19 |
|
procedure BitBtn2Click(Sender: TObject); |
| 20 |
private |
private |
| 21 |
{ Private 宣言 } |
{ Private 宣言 } |
| 22 |
FThreadLogFileName: String; |
FThreadLogFileName: String; |
| 23 |
FNGFileName: String; |
FNGFileName: String; |
| 24 |
|
FDeleteList: TStringList; |
| 25 |
public |
public |
| 26 |
{ Public 宣言 } |
{ Public 宣言 } |
| 27 |
FRepaint : boolean; |
FRepaint : boolean; |
| 28 |
ResNumber : Integer; |
ResNumber : Integer; |
| 29 |
function SetThreadLogFileName(AFileName: String): boolean; |
function SetThreadLogFileName(AFileName: String): boolean; |
| 30 |
function DeleteNG(AResNum: Integer): boolean; |
function DeleteNG(AResNum: Integer): boolean; |
| 31 |
|
property DeleteList : TStringList read FDeleteList write FDeleteList; |
| 32 |
end; |
end; |
| 33 |
|
|
| 34 |
var |
var |
| 59 |
end; |
end; |
| 60 |
end; |
end; |
| 61 |
|
|
|
//i := NGFile.IndexOf(str); |
|
| 62 |
if i >= 0 then begin |
if i >= 0 then begin |
| 63 |
FRepaint := true; |
FRepaint := true; |
| 64 |
|
DeleteList.Add(Copy(str, 1, Length(str) - 1)); |
| 65 |
NGFile.Delete(i); |
NGFile.Delete(i); |
| 66 |
if NGFile.Count = 0 then |
if NGFile.Count = 0 then |
| 67 |
DeleteFile(FNGFileName) |
DeleteFile(FNGFileName) |
| 91 |
try |
try |
| 92 |
NGFile.LoadFromFile(FNGFileName); |
NGFile.LoadFromFile(FNGFileName); |
| 93 |
ComboBox1.Items.Clear; |
ComboBox1.Items.Clear; |
| 94 |
|
ComboBox1.Sorted := true; |
| 95 |
for i := 0 to NGFile.Count - 1do begin |
for i := 0 to NGFile.Count - 1do begin |
| 96 |
str := Copy(NGFile.Strings[i], 1, AnsiPos('-', NGFile.Strings[i]) - 1); |
str := Copy(NGFile.Strings[i], 1, AnsiPos('-', NGFile.Strings[i]) - 1); |
| 97 |
if str <> '' then |
if str <> '' then |
| 99 |
end; |
end; |
| 100 |
if ComboBox1.Items.Count > 0 then |
if ComboBox1.Items.Count > 0 then |
| 101 |
Result := true; |
Result := true; |
| 102 |
|
|
| 103 |
except |
except |
| 104 |
Result := false; |
Result := false; |
| 105 |
end; |
end; |
| 122 |
try |
try |
| 123 |
NGFile.LoadFromFile(FNGFileName); |
NGFile.LoadFromFile(FNGFileName); |
| 124 |
str := IntToStr(AResNum) + '-'; |
str := IntToStr(AResNum) + '-'; |
| 125 |
i := -1; |
i := -1; |
| 126 |
for j := 0 to NGFile.Count - 1 do begin |
for j := 0 to NGFile.Count - 1 do begin |
| 127 |
if AnsiPos(str, NGFile[j]) = 1 then begin |
if AnsiPos(str, NGFile[j]) = 1 then begin |
| 128 |
i := j; |
i := j; |
| 140 |
except |
except |
| 141 |
end; |
end; |
| 142 |
finally |
finally |
| 143 |
|
NGFile.Free; |
| 144 |
|
end; |
| 145 |
|
end; |
| 146 |
|
end; |
| 147 |
|
|
| 148 |
|
procedure TIndividualAbonForm.FormCreate(Sender: TObject); |
| 149 |
|
begin |
| 150 |
|
FDeleteList := TStringList.Create; |
| 151 |
|
end; |
| 152 |
|
|
| 153 |
|
procedure TIndividualAbonForm.FormDestroy(Sender: TObject); |
| 154 |
|
begin |
| 155 |
|
FDeleteList.Free; |
| 156 |
|
end; |
| 157 |
|
|
| 158 |
|
procedure TIndividualAbonForm.BitBtn2Click(Sender: TObject); |
| 159 |
|
var |
| 160 |
|
NGFile: TStringList; |
| 161 |
|
i, j: Integer; |
| 162 |
|
|
| 163 |
|
str: String; |
| 164 |
|
begin |
| 165 |
|
if (FileExists(FNGFileName)) then begin |
| 166 |
|
NGFile := TStringList.Create; |
| 167 |
|
try |
| 168 |
|
try |
| 169 |
|
FRepaint := false; |
| 170 |
|
NGFile.LoadFromFile(FNGFileName); |
| 171 |
|
for i := ComboBox1.Items.Count - 1 downto 0 do begin |
| 172 |
|
str := ComboBox1.Items[i]; |
| 173 |
|
if( Length(str) > 0 ) then begin |
| 174 |
|
FRepaint := true; |
| 175 |
|
DeleteList.Add(str); |
| 176 |
|
NGFile.Delete(i); |
| 177 |
|
end; |
| 178 |
|
end; |
| 179 |
|
DeleteFile(FNGFileName); |
| 180 |
|
except |
| 181 |
|
end; |
| 182 |
|
finally |
| 183 |
NGFile.Free; |
NGFile.Free; |
| 184 |
end; |
end; |
| 185 |
end; |
end; |