5 Windows,Messages, ShellAPI, SysUtils, Classes,StdCtrls,StrUtils;
10 option: Integer; // 0:
\93§
\96¾ 1:
\92Ê
\8fí
\82 \82Ú
\81[
\82ñ
13 TAbon = class(TObject)
19 Ftokens : array of array of string;
20 FAbonRes : array of TIndiviAbon;
22 FCutoffNum : Integer; //
\82±
\82Ì
\90\94\88È
\8fã
\98A
\91±
\82·
\82é
\93¯
\82¶
\89p
\8e\9a\82ðNG
\83\8f\81[
\83h
\82Æ
\82·
\82é
23 FDeleterlo : Boolean; //&rlo;
\82ð
\8dí
\82é
\82©
24 FReplaceul :Boolean ; //<ul>
\83^
\83O
\82ð<br>
\83^
\83O
\82É
\92u
\8a·
\82·
\82é
\82©
25 FReverse : Boolean ; //NG
\83\8f\81[
\83h
\82Å
\82Ì
\82 \82Ú
\81`
\82ñ
\82Ì
\8c\8b\89Ê
\82ð
\94½
\93]
\82³
\82¹
\82é
\82©
26 FAbonPopupRes : Boolean; //
\83\8c\83X
\83|
\83b
\83v
\83A
\83b
\83v
\82Ì
\8e\9e\82É
\82 \82Ú
\81[
\82ñ
\82·
\82é
\82©
27 FCreateNGwordFile : Boolean; //
\8ew
\92è
\82³
\82ê
\82½path
\82ÉNG
\83\8f\81[
\83htxt
\82ª
\96³
\82©
\82Á
\82½
\82Æ
\82«
\82É
\8e©
\93®
\93I
\82É
\90¶
\90¬
\82·
\82é
\82©
28 FNGwordFileIndex : Integer; //
\8c»
\8dÝ
\93Ç
\82Ý
\8d\9e\82ñ
\82Å
\82éNG
\83\8f\81[
\83h
\82ªlist
\82Ì
\89½
\8ds
\96Ú
\82©
29 FNGwordname : String; //
\8c»
\8dÝ
\93Ç
\82Ý
\8d\9e\82ñ
\82Å
\82éNG
\83\8f\81[
\83h
\82Ì
\95\
\8e¦
\96¼
30 FIndividualFileName : String; //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\82Ì
\83t
\83@
\83C
\83\8b\96¼
31 procedure SetTokens(index: integer ; argline:String);
32 function Getlistpath() : String;
33 procedure Setlistpath(const Value : String);
34 function LoadListFile(path :String;listStringList : TStringList) : Boolean;
35 function ReadNGwordslist(line : Integer) : Boolean;
36 function LoadFromSetResNumFile(SetResNumFile : String) : Boolean;
39 constructor Create; //
\83R
\83\93\83X
\83g
\83\89\83N
\83^
40 destructor Destroy; override; //
\83f
\83X
\83g
\83\89\83N
\83^
41 property Deleterlo: Boolean read FDeleterlo write FDeleterlo default false;
42 property Replaceul: Boolean read FReplaceul write FReplaceul default false;
43 property Reverse: Boolean read FReverse write FReverse default false;
44 property CreateNGwordFile: Boolean read FCreateNGwordFile write FCreateNGwordFile;
45 property AbonString : String read FAbonString write FAbonString;
46 property AbonPopupRes : Boolean read FAbonPopupRes write FAbonPopupRes default false;
47 property listpath : String read Getlistpath write Setlistpath;
48 property NGwordFileIndex : Integer read FNGwordFileIndex write FNGwordFileIndex default 0;
49 property NGwordname : String read FNGwordname write FNGwordname;
50 procedure Setroot(root :String);
51 function Getroot() : String;
53 function Getfullpath(argpath : String) : String;
54 procedure SetNGwordpath(path :String);
55 function GetNGwordpath() : String;
56 function LoadFromNGwordFile(path :String) : Boolean;
57 function ReLoadFromNGwordFile() : Boolean;
58 procedure LoadFromStringList( bufstl : TStringList );
59 function CheckAbonPopupRes(line : String) :Boolean;
60 function FindNGwords(line : String) : Boolean; //1
\83\89\83C
\83\93\82¸
\82Â
\97p
\81B
61 function Cutoff(line : String) : Boolean; //CutOff
\92l
\88È
\8fã
\8cÂ
\82Ì
\93¯
\82¶
\89p
\90\94\82ª
\95À
\82ñ
\82Å
\82¢
\82½
\82çtrue
62 //
\82 \82Ú
\81`
\82ñ
\8f\88\97\9d(NG
\83\8f\81[
\83h
\82Å
\82Ì
\83t
\83B
\83\8b\83^
\83\8a\83\93\83O)
63 procedure Execute(var ThreadStrings : TStringList); overload;
64 procedure Execute(var ThreadStrings : TStringList; NGwords : TStringList); overload;
65 procedure Execute(var ThreadStrings : TStringList; NGwords : TStrings); overload;
66 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\82µ
\82å
\82è
67 procedure IndividualAbon(var ThreadStrings : TStringList; SetResNumFile : String);
68 procedure AddIndividualAbon( ResNum : Integer ; option : Integer);
69 procedure DeleteIndividualAbon( ResNum : Integer);
70 function GetAbonResCount() : Integer;
71 function GetAbonResString(Num : Integer) : String;
73 function ExecuteFile(datfilepath : String; NGwordpath : String) : Boolean; overload;//DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
74 function ExecuteFile(datfilepath : String; resnum : Integer) : Boolean; overload; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
75 function ExecuteFile(datfilepath : String; firstres : Integer; count : Integer) : Boolean; overload; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
76 function ReverseExecuteFile(datfilepath : String) : Boolean; overload; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
77 function ReverseExecuteFile(datfilepath : String; resnum : Integer) : Boolean; overload; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
78 function ReverseExecuteFile(datfilepath : String; firstres : Integer; count : Integer) : Boolean; overload; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
80 procedure EditNGwords(); //NGword.txt
\82ð
\8aJ
\82
\81B
81 function ShowAllTokens() : String; //
\83f
\83o
\83b
\83O
\97p
83 procedure GoHome();//List
\82Ì
\82P
\8ds
\96Ú
\82ð
\93Ç
\82Þ
84 function GoForward() : Boolean; //List
\82Ì
\88ê
\82Â
\8e\9f\82ÌNG
\83\8f\81[
\83h
\83t
\83@
\83C
\83\8b\82ð
\93Ç
\82Ý
\8d\9e\82Þ
85 function GoBack() : Boolean; //List
\82Ì
\88ê
\82Â
\91O
\82ÌNG
\83\8f\81[
\83h
\83t
\83@
\83C
\83\8b\82ð
\93Ç
\82Ý
\8d\9e\82Þ
90 NGwordListFileName : String = 'NGwords.list';
94 constructor TAbon.Create;
97 FAbonString := ' <> <> <> <><>';
98 FCreateNGwordFile := true;
99 SetLength(FAbonRes,1);
100 FAbonRes[0].Res := 0;
101 FAbonRes[0].option := -1;
105 destructor TAbon.Destroy;
109 //root
\82ÍExe\config\NGwords
\83t
\83H
\83\8b\83_
110 procedure TAbon.Setroot(root :String);
112 bufStringList : TStringList;
114 bufStringList := TStringList.Create;
116 if not DirectoryExists(root) then begin
119 if root[Length(root)] <> '\' then begin
122 Flistpath := root + NGwordListFileName;
123 LoadListFile(Flistpath, bufStringList);
129 function TAbon.Getroot() : String;
133 //NGwordpath
\82ÍNGword.txt
\82Ì
\83t
\83\8b\83p
\83X
134 procedure TAbon.SetNGwordpath(path :String);
136 FNGwordpath := Getfullpath(path);
137 LoadFromNGwordFile(FNGwordpath);
139 function TAbon.GetNGwordpath() : String;
141 Result := FNGwordpath;
143 //
\83t
\83\8b\83p
\83X
\82Å
\82È
\82¯
\82ê
\82Î
\83t
\83\8b\83p
\83X
\82É
\82µ
\82Ä
\95Ô
\82·
\81B
144 function TAbon.Getfullpath(argpath : String) : String;
146 if AnsiPos(':\',argpath) <> 2 then begin //
\83h
\83\89\83C
\83u
\82©
\82ç
\82Ì
\83t
\83\8b\83p
\83X
\82ª
\96³
\82¯
\82ê
\82Î
147 if Getroot() = '' then begin
148 Result := ''; //root
\83p
\83X
\82ª
\90Ý
\92è
\82³
\82ê
\82Ä
\82È
\82¢
\82©
\8bó
\82É
\82·
\82é
150 if (Froot[Length(Froot)] = '\') and (argpath[1] = '\') then begin //
\90æ
\93ª
\82Ì\
\82ð
\8dí
\8f\9c
153 Insert( Getroot(), argpath , 1);//root
\83p
\83X
\82ð
\91}
\93ü
161 //NGword
\83t
\83@
\83C
\83\8b\82Ì
\93Ç
\82Ý
\8d\9e\82Ý
162 function TAbon.LoadFromNGwordFile(path :String) : boolean;
164 bufstl : TStringList;
166 path := Getfullpath(path);
167 if path = '' then begin
170 bufstl := TStringList.Create;
173 bufstl.LoadFromFile(path);
174 LoadFromStringList( bufstl );
177 if CreateNGwordFile = true then begin
178 bufstl.SaveToFile(path);
188 //NGword
\83\8a\83X
\83g
\93Ç
\82Ý
\8d\9e\82Ý
189 procedure TAbon.LoadFromStringList( bufstl : TStringList );
194 for i := bufstl.Count -1 downto 0 do begin
195 if bufstl.Strings[i] = '' then begin
199 SetLength(Ftokens,bufstl.Count);
200 for i := 0 to bufstl.Count -1 do begin
201 SetTokens(i , bufstl.Strings[i]);
208 //NGwordpath
\82ª
\8aù
\82É
\90Ý
\92è
\82³
\82ê
\82Ä
\82¢
\82é
\82Æ
\82«
\82Ì
\83\8a\83\8d\81[
\83h
\97p
\8aÖ
\90\94
209 function TAbon.ReLoadFromNGwordFile() : boolean;
211 if GetNGwordpath() ='' then begin
214 Result := LoadFromNGwordFile( GetNGwordpath() );
217 function TAbon.Getlistpath() : String;
221 procedure TAbon.Setlistpath(const Value : String);
223 Flistpath := Getfullpath(Value);
225 //
\88ê
\8ds
\82Ì
\92\86\82Ì
\83g
\81[
\83N
\83\93\82ð
\90Ø
\82è
\95ª
\82¯
\82Ä
\83Z
\83b
\83g
226 procedure TAbon.SetTokens(index: integer ; argline : String);
229 bufstl : TStringList;
232 bufstl := TStringList.Create;
233 bufstl.Delimiter := #9; //
\8bæ
\90Ø
\82è
\8eq
\82ð
\81f
\83^
\83u
\81f
\82É
\90Ý
\92è
234 bufstl.DelimitedText := argline;
236 SetLength(Ftokens[index],ret);
237 for i := 0 to bufstl.Count - 1 do begin
238 Ftokens[index][i] := bufstl.Strings[i];
243 //Debug
\97p
\82¿
\82á
\82ñ
\82ÆNG
\83\8f\81[
\83h
\82ð
\8fE
\82¦
\82Ä
\82¢
\82é
\82©
244 function TAbon.ShowAllTokens() : String;
250 for i := 0 to High(Ftokens) do begin
251 for j := 0 to High(Ftokens[i]) do begin
252 ret := ret + Ftokens[i][j];
261 //****************************************************************************//
262 //NG
\83\8f\81[
\83h
\82ª
\8aÜ
\82Ü
\82ê
\82Ä
\82½
\82çtrue
\82ð
\95Ô
\82·
\81B
263 function TAbon.FindNGwords(line : String) : Boolean;
271 if AnsiPos(FAbonString,line) <> 1 then begin
272 for lines := 0 to High(Ftokens) do begin
275 for cells := 0 to High(Ftokens[lines]) do begin
276 if AnsiPos(Ftokens[lines][cells],bufline) = 0 then begin
280 Delete(bufline,AnsiPos(Ftokens[lines][cells],bufline),Length(Ftokens[lines][cells]));
283 if hit = true then begin
291 //CutOff
\92l
\88È
\8fã
\8cÂ
\82Ì
\93¯
\82¶
\89p
\90\94\82ª
\95À
\82ñ
\82Å
\82¢
\82½
\82çtrue
292 function TAbon.Cutoff(line : String) : Boolean;
300 if FCutoffNum <> 0 then begin
301 for i := 65 to 90 do begin
303 buf := DupeString(sheed, FCutoffNum);
304 if AnsiContainsText(line, buf) = true then begin
312 //
\96\96\94ö
\82Ì
\83u
\81[
\83\8b\92l
\82Ítrue
\82¾
\82Æ
\81ANG
\83\8f\81[
\83h
\82ð
\8aÜ
\82Þ
\82à
\82Ì
\82¾
\82¯
\82ð
\95Ô
\82·
\81B
313 procedure TAbon.Execute(var ThreadStrings : TStringList);
320 for i:=0 to ThreadStrings.Count - 1 do begin
321 if FindNGwords(ThreadStrings.Strings[i]) <> Reverse then begin
322 ThreadStrings.Strings[i] := FAbonString;
324 bufline := ThreadStrings.Strings[i];
325 if Deleterlo = true then begin
326 bufline := AnsiReplaceText( bufline,'&rlo;','' );
328 if Replaceul = true then begin
329 bufline := AnsiReplaceText( bufline,'<ul>','<br>' );
330 bufline := AnsiReplaceText( bufline,'</ul>','<br>' );
332 ThreadStrings.Strings[i] := bufline;
337 procedure TAbon.Execute(var ThreadStrings : TStringList; NGwords : TStringList);
341 SetLength(Ftokens,NGwords.Count);
342 for i := 0 to NGwords.Count -1 do begin
343 SetTokens(i , NGwords.Strings[i]);
345 Execute(ThreadStrings);
348 procedure TAbon.Execute(var ThreadStrings : TStringList; NGwords : TStrings);
353 buf := TStringList.Create;
354 buf.AddStrings(NGwords);
355 SetLength(Ftokens,buf.Count);
356 for i := 0 to buf.Count -1 do begin
357 SetTokens(i , buf.Strings[i]);
359 Execute(ThreadStrings);
364 //****************************************************************************//
365 //DAT
\82ð
\92¼
\82É
\82¢
\82¶
\82é
\93z
\82ç===========================================================
366 //NG
\83\8f\81[
\83h
\82ð
\8aÜ
\82Þ
\83\8c\83X
\82Ì
\90æ
\93ª
\82É
\82 \82Ú
\81[
\82ñ
\82ð
\91}
\93ü
367 function TAbon.ExecuteFile(datfilepath : String; NGwordpath : String) : Boolean; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
369 datstl : TStringList;
373 datstl := TStringList.Create;
377 datstl.LoadFromFile(datfilepath);
378 for i := 0 to datstl.Count -1 do begin
379 if FindNGwords(datstl.Strings[i]) = true then begin
380 datstl.Strings[i] := FAbonString + datstl.Strings[i]
384 datstl.SaveToFile(datfilepath);
394 //
\8ew
\92è
\82³
\82ê
\82½
\83\8c\83X
\94Ô
\82Ì
\90æ
\93ª
\82É
\82 \82Ú
\81[
\82ñ
\91}
\93ü
395 function TAbon.ExecuteFile(datfilepath : String; resnum : Integer) : Boolean; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
397 datstl : TStringList;
401 datstl := TStringList.Create;
404 datstl.LoadFromFile(datfilepath);
405 if (resnum > 0) and (resnum <= datstl.Count) then begin
406 if AnsiPos(FAbonString, datstl.Strings[resnum-1]) <> 1 then begin
407 datstl.Strings[resnum-1] := FAbonString + datstl.Strings[resnum-1];
410 datstl.SaveToFile(datfilepath);
419 //firstres
\82©
\82çcount
\8cÂ
\82Ì
\83\8c\83X
\82Ì
\90æ
\93ª
\82É
\82 \82Ú
\81[
\82ñ
\91}
\93ü
420 function TAbon.ExecuteFile(datfilepath : String; firstres : Integer; count : Integer) : Boolean; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
422 datstl : TStringList;
424 endnum : Integer; //
\8fI
\82í
\82è
\82Ì
\83\8c\83X
\94Ô
428 datstl := TStringList.Create;
431 datstl.LoadFromFile(datfilepath);
432 if (firstres > 0) and (firstres <= datstl.Count) then begin
433 if firstres + count -1 > datstl.Count then begin
434 endnum := datstl.Count;
435 end else if count <= 0 then begin
436 endnum := firstres + 1;
438 endnum := firstres + count -1;
441 for i := firstres to endnum do begin
442 if AnsiPos(FAbonString, datstl.Strings[i-1]) <> 1 then begin
443 datstl.Strings[i-1] := FAbonString + datstl.Strings[i-1];
447 datstl.SaveToFile(datfilepath);
456 //DAT
\82ð
\92¼
\82É
\82¢
\82¶
\82é
\93z
\82ç==========
\82±
\82±
\82Ü
\82Å=========================================
458 //
\8c³
\82É
\96ß
\82·
\93z
\82ç==================================================================
459 function TAbon.ReverseExecuteFile(datfilepath : String) : Boolean; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
461 datstl : TStringList;
467 datstl := TStringList.Create;
470 datstl.LoadFromFile(datfilepath);
471 for i:=0 to datstl.Count -1 do begin
472 if AnsiPos(FAbonString, datstl.Strings[i]) = 1 then begin
473 buf := datstl.Strings[i];
474 Delete(buf,1,Length(FAbonString));
475 datstl.Strings[i] := buf;
478 datstl.SaveToFile(datfilepath);
488 function TAbon.ReverseExecuteFile(datfilepath : String; resnum : Integer) : Boolean; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
490 datstl : TStringList;
495 datstl := TStringList.Create;
498 datstl.LoadFromFile(datfilepath);
499 if (resnum > 0) and (resnum <= datstl.Count) then begin
500 if AnsiPos(FAbonString, datstl.Strings[resnum-1]) = 1 then begin
501 buf := datstl.Strings[resnum-1];
502 Delete(buf,1,Length(FAbonString));
503 datstl.Strings[resnum-1] := buf;
506 datstl.SaveToFile(datfilepath);
516 function TAbon.ReverseExecuteFile(datfilepath : String; firstres : Integer; count : Integer) : Boolean;//DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
518 datstl : TStringList;
520 endnum : Integer; //
\8fI
\82í
\82è
\82Ì
\83\8c\83X
\94Ô
525 datstl := TStringList.Create;
528 datstl.LoadFromFile(datfilepath);
529 if (firstres > 0) and (firstres <= datstl.Count) then begin
530 if firstres + count -1 > datstl.Count then begin
531 endnum := datstl.Count;
532 end else if count <= 0 then begin
533 endnum := firstres + 1;
535 endnum := firstres + count -1;
537 for i := firstres to endnum do begin
538 if AnsiPos(FAbonString, datstl.Strings[i-1]) = 1 then begin
539 buf := datstl.Strings[i-1];
540 Delete(buf,1,Length(FAbonString));
541 datstl.Strings[i-1] := buf;
545 datstl.SaveToFile(datfilepath);
554 //
\8c³
\82É
\96ß
\82·
\93z
\82ç=================
\82±
\82±
\82Ü
\82Å=========================================
555 //
\8c»
\8dÝ
\83Z
\83b
\83g
\82³
\82ê
\82Ä
\82¢
\82éNGword.txt
\82ð
\8aJ
\82
556 procedure TAbon.EditNGwords();
558 ShellExecute(0 ,nil,PChar(FNGwordpath),nil,nil,SW_SHOW);
560 function TAbon.CheckAbonPopupRes(line : String) :Boolean;
562 if AbonPopupRes = true then begin
563 Result := FindNGwords(line);
568 //
\95¡
\90\94\82ÌNG
\83\8f\81[
\83h
\83e
\83L
\83X
\83g
\82ð
\93Ç
\82Ý
\8d\9e\82Þ==============================================
569 //List
\83t
\83@
\83C
\83\8b\82ð
\93Ç
\82Ý
\8d\9e\82Þ
570 function TAbon.LoadListFile(path :String; listStringList : TStringList) : Boolean;
573 listStringList.LoadFromFile(path);
576 listStringList.Append('
\88ê
\94Ê=NGword.txt');
577 listStringList.SaveToFile(path);
581 //List
\82Ì
\88ê
\82Â
\8e\9f\82ÌNG
\83\8f\81[
\83h
\83t
\83@
\83C
\83\8b\82ð
\93Ç
\82Ý
\8d\9e\82Þ
582 function TAbon.GoForward() : Boolean;
584 FNGwordFileIndex := FNGwordFileIndex + 1;
585 Result := ReadNGwordslist(FNGwordFileIndex);
587 //List
\82Ì
\88ê
\82Â
\91O
\82ÌNG
\83\8f\81[
\83h
\83t
\83@
\83C
\83\8b\82ð
\93Ç
\82Ý
\8d\9e\82Þ
588 function TAbon.GoBack() : Boolean;
590 FNGwordFileIndex := FNGwordFileIndex -1;
591 Result := ReadNGwordslist(FNGwordFileIndex);
593 //List
\82Ì
\82P
\8ds
\96Ú
\82ð
\93Ç
\82Þ
594 procedure TAbon.GoHome();
596 FNGwordFileIndex := 0;
597 ReadNGwordslist(FNGwordFileIndex);
599 //List
\82Ìline
\8ds
\96Ú
\82ð
\93Ç
\82Þ
600 function TAbon.ReadNGwordslist(line : Integer) : Boolean;
602 liststl : TStringList;
605 liststl := TStringList.Create;
607 if LoadListFile(Flistpath,liststl) = true then begin
608 if line < 0 then begin
609 line := liststl.Count - 1;
610 FNGwordFileIndex := liststl.Count - 1;
611 end else if line > liststl.Count - 1 then begin
613 FNGwordFileIndex := 0;
615 linebuf := liststl.Strings[line];
616 FNGwordname := Copy(linebuf,1,AnsiPos('=',linebuf)-1);
617 Delete(linebuf,1,AnsiPos('=',linebuf));
618 SetNGwordpath(linebuf);
628 //
\95¡
\90\94\82ÌNG
\83\8f\81[
\83h
\83e
\83L
\83X
\83g
\82ð
\93Ç
\82Ý
\8d\9e\82Þ=====
\82±
\82±
\82Ü
\82Å=================================
629 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\8eÀ
\8ds
\8aÖ
\90\94
630 procedure TAbon.IndividualAbon(var ThreadStrings : TStringList; SetResNumFile : String);
634 if FileExists(SetResNumFile) = true then begin
635 if LoadFromSetResNumFile(SetResNumFile) = true then begin
636 for i := 0 to High(FAbonRes) do begin
637 if (FAbonRes[i].Res <= ThreadStrings.Count) and (FAbonRes[i].Res > 0) then begin
638 if FAbonRes[i].option = 0 then begin
639 ThreadStrings.Strings[FAbonRes[i].Res-1] := '';
641 ThreadStrings.Strings[FAbonRes[i].Res-1] := '
\82 \82Ú
\81[
\82ñ<>
\82 \82Ú
\81[
\82ñ<>
\82 \82Ú
\81[
\82ñ<>
\82 \82Ú
\81[
\82ñ<>';
648 FIndividualFileName := SetResNumFile;
649 SetLength(FAbonRes,1);
650 FAbonRes[0].Res := 0;
651 FAbonRes[0].option := -1;
654 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\83t
\83@
\83C
\83\8b\93Ç
\82Ý
\8d\9e\82Ý
\8aÖ
\90\94
655 function TAbon.LoadFromSetResNumFile(SetResNumFile : String) : Boolean;
657 bufStringList : TStringList;
661 bufStringList := TStringList.Create;
664 bufStringList.LoadFromFile(SetResNumFile);
665 FIndividualFileName := SetResNumFile;
667 for i := bufStringList.Count-1 downto 0 do begin
668 if bufStringList.Strings[i] = '' then begin
669 bufStringList.Delete(i);
673 //
\83\81\83\82\83\8a\8am
\95Û
674 SetLength(FAbonRes,bufStringList.Count);
676 for i :=0 to bufStringList.Count - 1 do begin
677 bufLine := Trim(bufStringList.Strings[i]);
678 FAbonRes[i].Res := StrToInt(Copy(bufLine,1,AnsiPos('-',bufLine)-1));
679 FAbonRes[i].option := StrToInt(Copy(bufLine,AnsiPos('-',bufLine)+1,1));
690 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\83t
\83@
\83C
\83\8b\82É
\92Ç
\89Á
691 procedure TAbon.AddIndividualAbon( ResNum : Integer ; option : Integer);
693 IndividualFile : TStringList;
697 IndividualFile := TStringList.Create;
698 if FAbonRes[0].Res <> 0 then begin
699 for i := 0 to High(FAbonRes) do begin
700 if FAbonRes[i].Res <> ResNum then begin
701 linebuf := IntToStr(FAbonRes[i].Res) + '-' + IntToStr(FabonRes[i].option);
702 IndividualFile.Append(linebuf);
706 linebuf := IntToStr(ResNum) + '-' + IntToStr(option);
707 IndividualFile.Append(linebuf);
709 IndividualFile.SaveToFile(FIndividualFileName);
714 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\83t
\83@
\83C
\83\8b\82©
\82ç
\8dí
\8f\9c
715 procedure TAbon.DeleteIndividualAbon( ResNum : Integer);
717 IndividualFile : TStringList;
721 IndividualFile := TStringList.Create;
722 if FAbonRes[0].Res <> 0 then begin
723 for i := 0 to High(FAbonRes) do begin
724 if FAbonRes[i].Res <> ResNum then begin
725 linebuf := IntToStr(FAbonRes[i].Res) + '-' + IntToStr(FabonRes[i].option);
726 IndividualFile.Append(linebuf);
730 if IndividualFile.Count <> 0 then begin
732 IndividualFile.SaveToFile(FIndividualFileName);
737 if FileExists(FIndividualFileName) = true then begin
738 DeleteFile(FIndividualFileName);
742 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\82Ì
\83\8a\83X
\83g
\82Ì
\8cÂ
\90\94\82ð
\95Ô
\82·
743 function TAbon.GetAbonResCount() : Integer;
745 Result := High(FAbonRes);
747 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\82Ì
\83\8a\83X
\83g
\82Ì
\82\8e\8ds
\96Ú
\82Ì
\83\8c\83X
\82ð
\95¶
\8e\9a\97ñ
\82Å
\95Ô
\82·
748 function TAbon.GetAbonResString(Num : Integer) : String;
750 if (Num < High(FAbonRes)) and (Num >= 0) then begin
751 Result := IntToStr(FAbonRes[Num].Res);