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© //
\92Ç
\89Á&lro;
\82à
\8dí
\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 FReturnNGwordLineNum : Boolean; //NG
\83\8f\81[
\83h
\82Ì
\8ds
\90\94\82ð
\95Ô
\82·
\81B
32 FSetNGResAnchor : Boolean; //NG
\82É
\8aY
\93\96\82µ
\82½
\82Æ
\82«
\82É
\96{
\95¶
\82É
\82»
\82Ì
\83\8c\83X
\82Ö
\82Ì
\83\8c\83X
\83A
\83\93\83J
\81[
\82ð
\82Â
\82¯
\82é
\82©
\82Ç
\82¤
\82©
33 procedure SetTokens(index: integer ; argline:String);
34 function Getlistpath() : String;
35 procedure Setlistpath(const Value : String);
36 function LoadListFile(path :String;listStringList : TStringList) : Boolean;
37 function ReadNGwordslist(line : Integer) : Boolean;
38 function LoadFromSetResNumFile(SetResNumFile : String) : Boolean;
41 constructor Create; //
\83R
\83\93\83X
\83g
\83\89\83N
\83^
42 destructor Destroy; override; //
\83f
\83X
\83g
\83\89\83N
\83^
43 property Deleterlo: Boolean read FDeleterlo write FDeleterlo default false;
44 property Replaceul: Boolean read FReplaceul write FReplaceul default false;
45 property Reverse: Boolean read FReverse write FReverse default false;
46 property CreateNGwordFile: Boolean read FCreateNGwordFile write FCreateNGwordFile;
47 property AbonString : String read FAbonString write FAbonString;
48 property AbonPopupRes : Boolean read FAbonPopupRes write FAbonPopupRes default false;
49 property listpath : String read Getlistpath write Setlistpath;
50 property NGwordFileIndex : Integer read FNGwordFileIndex write FNGwordFileIndex default 0;
51 property NGwordname : String read FNGwordname write FNGwordname;
52 property ReturnNGwordLineNum : Boolean read FReturnNGwordLineNum write FReturnNGwordLineNum default false;
53 property SetNGResAnchor : Boolean read FSetNGResAnchor write FSetNGResAnchor default false;
54 procedure Setroot(root :String);
55 function Getroot() : String;
57 function Getfullpath(argpath : String) : String;
58 procedure SetNGwordpath(path :String);
59 function GetNGwordpath() : String;
60 function LoadFromNGwordFile(path :String) : Boolean;
61 function ReLoadFromNGwordFile() : Boolean;
62 procedure LoadFromStringList( bufstl : TStringList );
63 function CheckAbonPopupRes(line : String) :Boolean;
64 function FindNGwords(line : String) : Boolean; overload;//1
\83\89\83C
\83\93\82¸
\82Â
\97p
\81B
65 function FindNGwords(line : String; var NGwordsLineNum : Integer) : Boolean; overload;//1
\83\89\83C
\83\93\82¸
\82Â
\97p
\81B
66 function FindNGwords(line : String; var NGwordsLineNum : Integer; var Invisible : Boolean) : Boolean; overload;//1
\83\89\83C
\83\93\82¸
\82Â
\97p
\81B
67 function Cutoff(line : String) : Boolean; //CutOff
\92l
\88È
\8fã
\8cÂ
\82Ì
\93¯
\82¶
\89p
\90\94\82ª
\95À
\82ñ
\82Å
\82¢
\82½
\82çtrue
68 //
\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)
69 procedure Execute(var ThreadStrings : TStringList); overload;
70 procedure Execute(var ThreadStrings : TStringList; NGwords : TStringList); overload;
71 procedure Execute(var ThreadStrings : TStringList; NGwords : TStrings); overload;
72 procedure Execute(var ResString : String; ResNumber : Integer); overload; //
\8eå
\82Éplugin
\82©
\82ç
\82ÌDat To HTML
\97p
73 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\82µ
\82å
\82è
74 procedure IndividualAbon(var ThreadStrings : TStringList; SetResNumFile : String); overload;
75 procedure IndividualAbon(var ResString : String; SetResNumFile : String; ResNumber : Integer); overload;
76 procedure AddIndividualAbon( ResNum : Integer ; option : Integer);
77 procedure DeleteIndividualAbon( ResNum : Integer);
78 function GetAbonResCount() : Integer;
79 function GetAbonResString(Num : Integer) : String;
80 function CheckIndividualAbonList(ResNum : Integer) : Boolean;
82 function ExecuteFile(datfilepath : String; NGwordpath : String) : Boolean; overload;//DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
83 function ExecuteFile(datfilepath : String; resnum : Integer) : Boolean; overload; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
84 function ExecuteFile(datfilepath : String; firstres : Integer; count : Integer) : Boolean; overload; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
85 function ReverseExecuteFile(datfilepath : String) : Boolean; overload; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
86 function ReverseExecuteFile(datfilepath : String; resnum : Integer) : Boolean; overload; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
87 function ReverseExecuteFile(datfilepath : String; firstres : Integer; count : Integer) : Boolean; overload; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
89 procedure EditNGwords(); //NGword.txt
\82ð
\8aJ
\82
\81B
90 function ShowAllTokens() : String; //
\83f
\83o
\83b
\83O
\97p
92 procedure GoHome();//List
\82Ì
\82P
\8ds
\96Ú
\82ð
\93Ç
\82Þ
93 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Þ
94 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Þ
99 NGwordListFileName : String = 'NGwords.list';
105 constructor TAbon.Create;
108 FAbonString := ' <> <> <> <><>';
109 FCreateNGwordFile := true;
110 SetLength(FAbonRes,1);
111 FAbonRes[0].Res := 0;
112 FAbonRes[0].option := -1;
116 destructor TAbon.Destroy;
120 //root
\82ÍExe\config\NGwords
\83t
\83H
\83\8b\83_
121 procedure TAbon.Setroot(root :String);
123 bufStringList : TStringList;
125 bufStringList := TStringList.Create;
127 if not DirectoryExists(root) then begin
130 if root[Length(root)] <> '\' then begin
133 Flistpath := root + NGwordListFileName;
134 LoadListFile(Flistpath, bufStringList);
140 function TAbon.Getroot() : String;
144 //NGwordpath
\82ÍNGword.txt
\82Ì
\83t
\83\8b\83p
\83X
145 procedure TAbon.SetNGwordpath(path :String);
147 FNGwordpath := Getfullpath(path);
148 LoadFromNGwordFile(FNGwordpath);
150 function TAbon.GetNGwordpath() : String;
152 Result := FNGwordpath;
154 //
\83t
\83\8b\83p
\83X
\82Å
\82È
\82¯
\82ê
\82Î
\83t
\83\8b\83p
\83X
\82É
\82µ
\82Ä
\95Ô
\82·
\81B
155 function TAbon.Getfullpath(argpath : String) : String;
157 if AnsiPos(':\',argpath) <> 2 then begin //
\83h
\83\89\83C
\83u
\82©
\82ç
\82Ì
\83t
\83\8b\83p
\83X
\82ª
\96³
\82¯
\82ê
\82Î
158 if Getroot() = '' then begin
159 Result := ''; //root
\83p
\83X
\82ª
\90Ý
\92è
\82³
\82ê
\82Ä
\82È
\82¢
\82©
\8bó
\82É
\82·
\82é
161 if (Froot[Length(Froot)] = '\') and (argpath[1] = '\') then begin //
\90æ
\93ª
\82Ì\
\82ð
\8dí
\8f\9c
164 Insert( Getroot(), argpath , 1);//root
\83p
\83X
\82ð
\91}
\93ü
172 //NGword
\83t
\83@
\83C
\83\8b\82Ì
\93Ç
\82Ý
\8d\9e\82Ý
173 function TAbon.LoadFromNGwordFile(path :String) : boolean;
175 bufstl : TStringList;
177 path := Getfullpath(path);
178 if path = '' then begin
181 bufstl := TStringList.Create;
184 bufstl.LoadFromFile(path);
185 LoadFromStringList( bufstl );
188 if CreateNGwordFile = true then begin
189 bufstl.SaveToFile(path);
199 //NGword
\83\8a\83X
\83g
\93Ç
\82Ý
\8d\9e\82Ý
200 procedure TAbon.LoadFromStringList( bufstl : TStringList );
205 for i := bufstl.Count -1 downto 0 do begin
206 if bufstl.Strings[i] = '' then begin
210 SetLength(Ftokens,bufstl.Count);
211 for i := 0 to bufstl.Count -1 do begin
212 SetTokens(i , bufstl.Strings[i]);
219 //NGwordpath
\82ª
\8aù
\82É
\90Ý
\92è
\82³
\82ê
\82Ä
\82¢
\82é
\82Æ
\82«
\82Ì
\83\8a\83\8d\81[
\83h
\97p
\8aÖ
\90\94
220 function TAbon.ReLoadFromNGwordFile() : boolean;
222 if GetNGwordpath() ='' then begin
225 Result := LoadFromNGwordFile( GetNGwordpath() );
228 function TAbon.Getlistpath() : String;
232 procedure TAbon.Setlistpath(const Value : String);
234 Flistpath := Getfullpath(Value);
236 //
\88ê
\8ds
\82Ì
\92\86\82Ì
\83g
\81[
\83N
\83\93\82ð
\90Ø
\82è
\95ª
\82¯
\82Ä
\83Z
\83b
\83g
237 procedure TAbon.SetTokens(index: integer ; argline : String);
240 bufstl : TStringList;
246 bufstl := TStringList.Create;
248 if Length(argline) > 0 then begin
249 pos := AnsiPos(#9,argline);
250 while pos <> 0 DO begin
251 buftoken := Copy(argline,1,pos-1);
252 Delete(argline,1,pos);
253 if Length(buftoken) > 0 then begin
254 bufstl.Append(buftoken);
255 end else if ( bufstl.Count = 0 ) then begin
258 pos := AnsiPos(#9,argline);
260 if Length(argline) > 0 then begin
261 bufstl.Append(argline);
264 SetLength(Ftokens[index],ret);
265 for i := 0 to bufstl.Count - 1 do begin
266 Ftokens[index][i] := bufstl.Strings[i];
274 //Debug
\97p
\82¿
\82á
\82ñ
\82ÆNG
\83\8f\81[
\83h
\82ð
\8fE
\82¦
\82Ä
\82¢
\82é
\82©
275 function TAbon.ShowAllTokens() : String;
281 for i := 0 to High(Ftokens) do begin
282 for j := 0 to High(Ftokens[i]) do begin
283 ret := ret + Ftokens[i][j];
292 //****************************************************************************//
293 //NG
\83\8f\81[
\83h
\82ª
\8aÜ
\82Ü
\82ê
\82Ä
\82½
\82çtrue
\82ð
\95Ô
\82·
\81B
294 function TAbon.FindNGwords(line : String) : Boolean;
302 if AnsiPos(FAbonString,line) <> 1 then begin
303 for lines := 0 to High(Ftokens) do begin
306 for cells := 0 to High(Ftokens[lines]) do begin
307 if AnsiPos(Ftokens[lines][cells],bufline) = 0 then begin
311 Delete(bufline,AnsiPos(Ftokens[lines][cells],bufline),Length(Ftokens[lines][cells]));
314 if hit = true then begin
321 //NG
\83\8f\81[
\83h
\82ª
\8aÜ
\82Ü
\82ê
\82Ä
\82¢
\82½
\82çtrue
\82ð
\95Ô
\82µ
\81A
\82»
\82ÌNG
\83\8f\81[
\83h
\82Ì
\8ds
\90\94\82ðNGwordsLineNum
\82É
\93ü
\82ê
\82Ä
\95Ô
\82·
322 function TAbon.FindNGwords(line : String; var NGwordsLineNum : Integer) : Boolean;
330 if AnsiPos(FAbonString,line) <> 1 then begin
331 for lines := 0 to High(Ftokens) do begin
334 for cells := 0 to High(Ftokens[lines]) do begin
335 if AnsiPos(Ftokens[lines][cells],bufline) = 0 then begin
339 Delete(bufline,AnsiPos(Ftokens[lines][cells],bufline),Length(Ftokens[lines][cells]));
342 if hit = true then begin
343 NGwordsLineNum := lines + 1;
350 //NG
\83\8f\81[
\83h
\82ª
\8aÜ
\82Ü
\82ê
\82Ä
\82¢
\82½
\82çtrue
\82ð
\95Ô
\82µ
\81A
\82»
\82ÌNG
\83\8f\81[
\83h
\82Ì
\8ds
\90\94\82ðNGwordsLineNum
\82É
\93ü
\82ê
\82Ä
\95Ô
\82·
\81B
351 //
\82à
\82µ
\82à
\93§
\96¾
\82 \82Ú
\81`
\82ñ
\82É
\82·
\82é
\82È
\82çInbisible
\82ðtrue
\82É
\82µ
\82Ä
\95Ô
\82·
352 function TAbon.FindNGwords(line : String; var NGwordsLineNum : Integer; var Invisible : Boolean) : Boolean; //1
\83\89\83C
\83\93\82¸
\82Â
\97p
\81B
361 if AnsiPos(FAbonString,line) <> 1 then begin
362 for lines := 0 to High(Ftokens) do begin
365 if Ftokens[lines][0] <> '' then begin
373 for cells := start to High(Ftokens[lines]) do begin
374 if AnsiPos(Ftokens[lines][cells],bufline) = 0 then begin
378 Delete(bufline,AnsiPos(Ftokens[lines][cells],bufline),Length(Ftokens[lines][cells]));
381 if hit = true then begin
382 NGwordsLineNum := lines + 1;
390 //CutOff
\92l
\88È
\8fã
\8cÂ
\82Ì
\93¯
\82¶
\89p
\90\94\82ª
\95À
\82ñ
\82Å
\82¢
\82½
\82çtrue
391 function TAbon.Cutoff(line : String) : Boolean;
399 if FCutoffNum <> 0 then begin
400 for i := 65 to 90 do begin
402 buf := DupeString(sheed, FCutoffNum);
403 if AnsiContainsText(line, buf) = true then begin
411 //
\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
412 procedure TAbon.Execute(var ThreadStrings : TStringList);
415 NGwordsLine : Integer;
419 for i:=0 to ThreadStrings.Count - 1 do begin
421 if FindNGwords(ThreadStrings.Strings[i], NGwordsLine ,invisi) <> Reverse then begin
422 if invisi = true then begin
423 ThreadStrings.Strings[i] := '';
425 if not ReturnNGwordLineNum and not SetNGResAnchor then begin
426 ThreadStrings.Strings[i] := FAbonString;
427 end else if not ReturnNGwordLineNum then begin
428 ThreadStrings.Strings[i] := Format(' <> <> <>>%d<><>',[(i+1)]);
429 end else if not SetNGResAnchor then begin
430 ThreadStrings.Strings[i] := Format(' <> <> <><B> %d
\8ds
\96Ú
\82ÌNG
\83\8f\81[
\83h
\82ª
\8aÜ
\82Ü
\82ê
\82Ä
\82¢
\82Ü
\82·
\81B</B><><>',[NGwordsLine]);
432 ThreadStrings.Strings[i] := Format(' <> <> <><B> %d
\8ds
\96Ú
\82ÌNG
\83\8f\81[
\83h
\82ª
\8aÜ
\82Ü
\82ê
\82Ä
\82¢
\82Ü
\82·
\81B</B>>%d <><>',[NGwordsLine,(i+1)]);
436 bufline := ThreadStrings.Strings[i];
437 if Deleterlo = true then begin
438 bufline := CustomStringReplace(bufline,'&rlo;','');
439 bufline := CustomStringReplace(bufline,'&lro;','');
441 if Replaceul = true then begin
442 bufline := CustomStringReplace( bufline,'<ul>','<br>' );
443 bufline := CustomStringReplace( bufline,'</ul>','<br>' );
445 ThreadStrings.Strings[i] := bufline;
449 procedure TAbon.Execute(var ResString : String; ResNumber : Integer);
451 NGwordsLine : Integer;
456 if FindNGwords(ResString, NGwordsLine ,invisi) <> Reverse then begin
457 if invisi = true then begin
460 if not ReturnNGwordLineNum and not SetNGResAnchor then begin
461 ResString := FAbonString;
462 end else if not ReturnNGwordLineNum then begin
463 ResString := Format(' <> <> <>>%d<><>',[(ResNumber)]);
464 end else if not SetNGResAnchor then begin
465 ResString := Format(' <> <> <><B> %d
\8ds
\96Ú
\82ÌNG
\83\8f\81[
\83h
\82ª
\8aÜ
\82Ü
\82ê
\82Ä
\82¢
\82Ü
\82·
\81B</B><><>',[NGwordsLine]);
467 ResString := Format(' <> <> <><B> %d
\8ds
\96Ú
\82ÌNG
\83\8f\81[
\83h
\82ª
\8aÜ
\82Ü
\82ê
\82Ä
\82¢
\82Ü
\82·
\81B</B>>%d <><>',[NGwordsLine,(ResNumber)]);
471 bufline := ResString;
472 if Deleterlo = true then begin
473 bufline := CustomStringReplace( bufline,'&rlo;','' );
474 bufline := CustomStringReplace( bufline,'&lro;','' );
476 if Replaceul = true then begin
477 bufline := CustomStringReplace( bufline,'<ul>','<br>' );
478 bufline := CustomStringReplace( bufline,'</ul>','<br>' );
480 ResString := bufline;
484 procedure TAbon.Execute(var ThreadStrings : TStringList; NGwords : TStringList);
488 SetLength(Ftokens,NGwords.Count);
489 for i := 0 to NGwords.Count -1 do begin
490 SetTokens(i , NGwords.Strings[i]);
492 Execute(ThreadStrings);
495 procedure TAbon.Execute(var ThreadStrings : TStringList; NGwords : TStrings);
500 buf := TStringList.Create;
501 buf.AddStrings(NGwords);
502 SetLength(Ftokens,buf.Count);
503 for i := 0 to buf.Count -1 do begin
504 SetTokens(i , buf.Strings[i]);
506 Execute(ThreadStrings);
511 //****************************************************************************//
512 //DAT
\82ð
\92¼
\82É
\82¢
\82¶
\82é
\93z
\82ç===========================================================
513 //NG
\83\8f\81[
\83h
\82ð
\8aÜ
\82Þ
\83\8c\83X
\82Ì
\90æ
\93ª
\82É
\82 \82Ú
\81[
\82ñ
\82ð
\91}
\93ü
514 function TAbon.ExecuteFile(datfilepath : String; NGwordpath : String) : Boolean; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
516 datstl : TStringList;
520 datstl := TStringList.Create;
524 datstl.LoadFromFile(datfilepath);
525 for i := 0 to datstl.Count -1 do begin
526 if FindNGwords(datstl.Strings[i]) = true then begin
527 datstl.Strings[i] := FAbonString + datstl.Strings[i]
531 datstl.SaveToFile(datfilepath);
541 //
\8ew
\92è
\82³
\82ê
\82½
\83\8c\83X
\94Ô
\82Ì
\90æ
\93ª
\82É
\82 \82Ú
\81[
\82ñ
\91}
\93ü
542 function TAbon.ExecuteFile(datfilepath : String; resnum : Integer) : Boolean; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
544 datstl : TStringList;
548 datstl := TStringList.Create;
551 datstl.LoadFromFile(datfilepath);
552 if (resnum > 0) and (resnum <= datstl.Count) then begin
553 if AnsiPos(FAbonString, datstl.Strings[resnum-1]) <> 1 then begin
554 datstl.Strings[resnum-1] := FAbonString + datstl.Strings[resnum-1];
557 datstl.SaveToFile(datfilepath);
566 //firstres
\82©
\82çcount
\8cÂ
\82Ì
\83\8c\83X
\82Ì
\90æ
\93ª
\82É
\82 \82Ú
\81[
\82ñ
\91}
\93ü
567 function TAbon.ExecuteFile(datfilepath : String; firstres : Integer; count : Integer) : Boolean; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
569 datstl : TStringList;
571 endnum : Integer; //
\8fI
\82í
\82è
\82Ì
\83\8c\83X
\94Ô
575 datstl := TStringList.Create;
578 datstl.LoadFromFile(datfilepath);
579 if (firstres > 0) and (firstres <= datstl.Count) then begin
580 if firstres + count -1 > datstl.Count then begin
581 endnum := datstl.Count;
582 end else if count <= 0 then begin
583 endnum := firstres + 1;
585 endnum := firstres + count -1;
588 for i := firstres to endnum do begin
589 if AnsiPos(FAbonString, datstl.Strings[i-1]) <> 1 then begin
590 datstl.Strings[i-1] := FAbonString + datstl.Strings[i-1];
594 datstl.SaveToFile(datfilepath);
603 //DAT
\82ð
\92¼
\82É
\82¢
\82¶
\82é
\93z
\82ç==========
\82±
\82±
\82Ü
\82Å=========================================
605 //
\8c³
\82É
\96ß
\82·
\93z
\82ç==================================================================
606 function TAbon.ReverseExecuteFile(datfilepath : String) : Boolean; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
608 datstl : TStringList;
614 datstl := TStringList.Create;
617 datstl.LoadFromFile(datfilepath);
618 for i:=0 to datstl.Count -1 do begin
619 if AnsiPos(FAbonString, datstl.Strings[i]) = 1 then begin
620 buf := datstl.Strings[i];
621 Delete(buf,1,Length(FAbonString));
622 datstl.Strings[i] := buf;
625 datstl.SaveToFile(datfilepath);
635 function TAbon.ReverseExecuteFile(datfilepath : String; resnum : Integer) : Boolean; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
637 datstl : TStringList;
642 datstl := TStringList.Create;
645 datstl.LoadFromFile(datfilepath);
646 if (resnum > 0) and (resnum <= datstl.Count) then begin
647 if AnsiPos(FAbonString, datstl.Strings[resnum-1]) = 1 then begin
648 buf := datstl.Strings[resnum-1];
649 Delete(buf,1,Length(FAbonString));
650 datstl.Strings[resnum-1] := buf;
653 datstl.SaveToFile(datfilepath);
663 function TAbon.ReverseExecuteFile(datfilepath : String; firstres : Integer; count : Integer) : Boolean;//DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
665 datstl : TStringList;
667 endnum : Integer; //
\8fI
\82í
\82è
\82Ì
\83\8c\83X
\94Ô
672 datstl := TStringList.Create;
675 datstl.LoadFromFile(datfilepath);
676 if (firstres > 0) and (firstres <= datstl.Count) then begin
677 if firstres + count -1 > datstl.Count then begin
678 endnum := datstl.Count;
679 end else if count <= 0 then begin
680 endnum := firstres + 1;
682 endnum := firstres + count -1;
684 for i := firstres to endnum do begin
685 if AnsiPos(FAbonString, datstl.Strings[i-1]) = 1 then begin
686 buf := datstl.Strings[i-1];
687 Delete(buf,1,Length(FAbonString));
688 datstl.Strings[i-1] := buf;
692 datstl.SaveToFile(datfilepath);
701 //
\8c³
\82É
\96ß
\82·
\93z
\82ç=================
\82±
\82±
\82Ü
\82Å=========================================
702 //
\8c»
\8dÝ
\83Z
\83b
\83g
\82³
\82ê
\82Ä
\82¢
\82éNGword.txt
\82ð
\8aJ
\82
703 procedure TAbon.EditNGwords();
705 ShellExecute(0 ,nil,PChar(FNGwordpath),nil,nil,SW_SHOW);
707 //
\83|
\83b
\83v
\83A
\83b
\83v
\97p
\94»
\92è
\8aÖ
\90\94
708 function TAbon.CheckAbonPopupRes(line : String) :Boolean;
710 if AbonPopupRes = true then begin
711 Result := FindNGwords(line);
716 //
\95¡
\90\94\82ÌNG
\83\8f\81[
\83h
\83e
\83L
\83X
\83g
\82ð
\93Ç
\82Ý
\8d\9e\82Þ==============================================
717 //List
\83t
\83@
\83C
\83\8b\82ð
\93Ç
\82Ý
\8d\9e\82Þ
718 function TAbon.LoadListFile(path :String; listStringList : TStringList) : Boolean;
721 listStringList.LoadFromFile(path);
724 listStringList.Append('
\88ê
\94Ê=NGword.txt');
725 listStringList.SaveToFile(path);
729 //List
\82Ì
\88ê
\82Â
\8e\9f\82ÌNG
\83\8f\81[
\83h
\83t
\83@
\83C
\83\8b\82ð
\93Ç
\82Ý
\8d\9e\82Þ
730 function TAbon.GoForward() : Boolean;
732 FNGwordFileIndex := FNGwordFileIndex + 1;
733 Result := ReadNGwordslist(FNGwordFileIndex);
735 //List
\82Ì
\88ê
\82Â
\91O
\82ÌNG
\83\8f\81[
\83h
\83t
\83@
\83C
\83\8b\82ð
\93Ç
\82Ý
\8d\9e\82Þ
736 function TAbon.GoBack() : Boolean;
738 FNGwordFileIndex := FNGwordFileIndex -1;
739 Result := ReadNGwordslist(FNGwordFileIndex);
741 //List
\82Ì
\82P
\8ds
\96Ú
\82ð
\93Ç
\82Þ
742 procedure TAbon.GoHome();
744 FNGwordFileIndex := 0;
745 ReadNGwordslist(FNGwordFileIndex);
747 //List
\82Ìline
\8ds
\96Ú
\82ð
\93Ç
\82Þ
748 function TAbon.ReadNGwordslist(line : Integer) : Boolean;
750 liststl : TStringList;
753 liststl := TStringList.Create;
755 if LoadListFile(Flistpath,liststl) = true then begin
756 if line < 0 then begin
757 line := liststl.Count - 1;
758 FNGwordFileIndex := liststl.Count - 1;
759 end else if line > liststl.Count - 1 then begin
761 FNGwordFileIndex := 0;
763 linebuf := liststl.Strings[line];
764 FNGwordname := Copy(linebuf,1,AnsiPos('=',linebuf)-1);
765 Delete(linebuf,1,AnsiPos('=',linebuf));
766 SetNGwordpath(linebuf);
776 //
\95¡
\90\94\82ÌNG
\83\8f\81[
\83h
\83e
\83L
\83X
\83g
\82ð
\93Ç
\82Ý
\8d\9e\82Þ=====
\82±
\82±
\82Ü
\82Å=================================
777 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\8eÀ
\8ds
\8aÖ
\90\94
778 procedure TAbon.IndividualAbon(var ThreadStrings : TStringList; SetResNumFile : String);
782 if FileExists(SetResNumFile) = true then begin
783 if LoadFromSetResNumFile(SetResNumFile) = true then begin
784 for i := 0 to High(FAbonRes) do begin
785 if (FAbonRes[i].Res <= ThreadStrings.Count) and (FAbonRes[i].Res > 0) then begin
786 if FAbonRes[i].option = 0 then begin
787 ThreadStrings.Strings[FAbonRes[i].Res-1] := '';
789 ThreadStrings.Strings[FAbonRes[i].Res-1] := '
\82 \82Ú
\81`
\82ñ<>
\82 \82Ú
\81`
\82ñ<>
\82 \82Ú
\81`
\82ñ<>
\82 \82Ú
\81`
\82ñ<>';
796 FIndividualFileName := SetResNumFile;
797 SetLength(FAbonRes,1);
798 FAbonRes[0].Res := 0;
799 FAbonRes[0].option := -1;
802 procedure TAbon.IndividualAbon(var ResString : String; SetResNumFile : String; ResNumber : Integer);
806 if FileExists(SetResNumFile) = true then begin
807 if LoadFromSetResNumFile(SetResNumFile) = true then begin
808 for i := 0 to High(FAbonRes) do begin
809 if FAbonRes[i].Res = ResNumber then begin
810 if FAbonRes[i].option = 0 then begin
813 ResString := '
\82 \82Ú
\81`
\82ñ<>
\82 \82Ú
\81`
\82ñ<>
\82 \82Ú
\81`
\82ñ<>
\82 \82Ú
\81`
\82ñ<>';
820 FIndividualFileName := SetResNumFile;
821 SetLength(FAbonRes,1);
822 FAbonRes[0].Res := 0;
823 FAbonRes[0].option := -1;
827 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\83t
\83@
\83C
\83\8b\93Ç
\82Ý
\8d\9e\82Ý
\8aÖ
\90\94
828 function TAbon.LoadFromSetResNumFile(SetResNumFile : String) : Boolean;
830 bufStringList : TStringList;
834 bufStringList := TStringList.Create;
837 bufStringList.LoadFromFile(SetResNumFile);
838 FIndividualFileName := SetResNumFile;
840 for i := bufStringList.Count-1 downto 0 do begin
841 if bufStringList.Strings[i] = '' then begin
842 bufStringList.Delete(i);
846 //
\83\81\83\82\83\8a\8am
\95Û
847 SetLength(FAbonRes,bufStringList.Count);
849 for i :=0 to bufStringList.Count - 1 do begin
850 bufLine := Trim(bufStringList.Strings[i]);
851 FAbonRes[i].Res := StrToInt(Copy(bufLine,1,AnsiPos('-',bufLine)-1));
852 FAbonRes[i].option := StrToInt(Copy(bufLine,AnsiPos('-',bufLine)+1,1));
863 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\83t
\83@
\83C
\83\8b\82É
\92Ç
\89Á
864 procedure TAbon.AddIndividualAbon( ResNum : Integer ; option : Integer);
866 IndividualFile : TStringList;
870 IndividualFile := TStringList.Create;
871 if FAbonRes[0].Res <> 0 then begin
872 for i := 0 to High(FAbonRes) do begin
873 if FAbonRes[i].Res <> ResNum then begin
874 linebuf := IntToStr(FAbonRes[i].Res) + '-' + IntToStr(FabonRes[i].option);
875 IndividualFile.Append(linebuf);
879 linebuf := IntToStr(ResNum) + '-' + IntToStr(option);
880 IndividualFile.Append(linebuf);
882 IndividualFile.SaveToFile(FIndividualFileName);
887 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\83t
\83@
\83C
\83\8b\82©
\82ç
\8dí
\8f\9c
888 procedure TAbon.DeleteIndividualAbon( ResNum : Integer);
890 IndividualFile : TStringList;
894 IndividualFile := TStringList.Create;
895 if FAbonRes[0].Res <> 0 then begin
896 for i := 0 to High(FAbonRes) do begin
897 if FAbonRes[i].Res <> ResNum then begin
898 linebuf := IntToStr(FAbonRes[i].Res) + '-' + IntToStr(FabonRes[i].option);
899 IndividualFile.Append(linebuf);
903 if IndividualFile.Count <> 0 then begin
905 IndividualFile.SaveToFile(FIndividualFileName);
910 if FileExists(FIndividualFileName) = true then begin
911 DeleteFile(FIndividualFileName);
915 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\82Ì
\83\8a\83X
\83g
\82Ì
\8cÂ
\90\94\82ð
\95Ô
\82·
916 function TAbon.GetAbonResCount() : Integer;
920 if FAbonRes[0].Res = 0 then begin
927 //
\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·
928 function TAbon.GetAbonResString(Num : Integer) : String;
930 if (Num <= High(FAbonRes)) and (Num >= 0) then begin
931 Result := IntToStr(FAbonRes[Num].Res);
936 //
\83|
\83b
\83v
\83A
\83b
\83v
\82Ì
\94»
\92è
\97p
937 function TAbon.CheckIndividualAbonList(ResNum : Integer) : Boolean;
941 if FAbonRes[0].Res <> 0 then begin
942 for i := 0 to High(FAbonRes) do begin
943 if FAbonRes[i].Res = ResNum then begin