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);
452 NGwordsLine : Integer;
457 if FindNGwords(ResString, NGwordsLine ,invisi) <> Reverse then begin
458 if invisi = true then begin
461 if not ReturnNGwordLineNum and not SetNGResAnchor then begin
462 ResString := FAbonString;
463 end else if not ReturnNGwordLineNum then begin
464 ResString := Format(' <> <> <>>%d<><>',[(ResNumber)]);
465 end else if not SetNGResAnchor then begin
466 ResString := Format(' <> <> <><B> %d
\8ds
\96Ú
\82ÌNG
\83\8f\81[
\83h
\82ª
\8aÜ
\82Ü
\82ê
\82Ä
\82¢
\82Ü
\82·
\81B</B><><>',[NGwordsLine]);
468 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)]);
472 bufline := ResString;
473 if Deleterlo = true then begin
474 bufline := CustomStringReplace( bufline,'&rlo;','' );
475 bufline := CustomStringReplace( bufline,'&lro;','' );
477 if Replaceul = true then begin
478 bufline := CustomStringReplace( bufline,'<ul>','<br>' );
479 bufline := CustomStringReplace( bufline,'</ul>','<br>' );
481 ResString := bufline;
485 procedure TAbon.Execute(var ThreadStrings : TStringList; NGwords : TStringList);
489 SetLength(Ftokens,NGwords.Count);
490 for i := 0 to NGwords.Count -1 do begin
491 SetTokens(i , NGwords.Strings[i]);
493 Execute(ThreadStrings);
496 procedure TAbon.Execute(var ThreadStrings : TStringList; NGwords : TStrings);
501 buf := TStringList.Create;
502 buf.AddStrings(NGwords);
503 SetLength(Ftokens,buf.Count);
504 for i := 0 to buf.Count -1 do begin
505 SetTokens(i , buf.Strings[i]);
507 Execute(ThreadStrings);
512 //****************************************************************************//
513 //DAT
\82ð
\92¼
\82É
\82¢
\82¶
\82é
\93z
\82ç===========================================================
514 //NG
\83\8f\81[
\83h
\82ð
\8aÜ
\82Þ
\83\8c\83X
\82Ì
\90æ
\93ª
\82É
\82 \82Ú
\81[
\82ñ
\82ð
\91}
\93ü
515 function TAbon.ExecuteFile(datfilepath : String; NGwordpath : String) : Boolean; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
517 datstl : TStringList;
521 datstl := TStringList.Create;
525 datstl.LoadFromFile(datfilepath);
526 for i := 0 to datstl.Count -1 do begin
527 if FindNGwords(datstl.Strings[i]) = true then begin
528 datstl.Strings[i] := FAbonString + datstl.Strings[i]
532 datstl.SaveToFile(datfilepath);
542 //
\8ew
\92è
\82³
\82ê
\82½
\83\8c\83X
\94Ô
\82Ì
\90æ
\93ª
\82É
\82 \82Ú
\81[
\82ñ
\91}
\93ü
543 function TAbon.ExecuteFile(datfilepath : String; resnum : Integer) : Boolean; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
545 datstl : TStringList;
549 datstl := TStringList.Create;
552 datstl.LoadFromFile(datfilepath);
553 if (resnum > 0) and (resnum <= datstl.Count) then begin
554 if AnsiPos(FAbonString, datstl.Strings[resnum-1]) <> 1 then begin
555 datstl.Strings[resnum-1] := FAbonString + datstl.Strings[resnum-1];
558 datstl.SaveToFile(datfilepath);
567 //firstres
\82©
\82çcount
\8cÂ
\82Ì
\83\8c\83X
\82Ì
\90æ
\93ª
\82É
\82 \82Ú
\81[
\82ñ
\91}
\93ü
568 function TAbon.ExecuteFile(datfilepath : String; firstres : Integer; count : Integer) : Boolean; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
570 datstl : TStringList;
572 endnum : Integer; //
\8fI
\82í
\82è
\82Ì
\83\8c\83X
\94Ô
576 datstl := TStringList.Create;
579 datstl.LoadFromFile(datfilepath);
580 if (firstres > 0) and (firstres <= datstl.Count) then begin
581 if firstres + count -1 > datstl.Count then begin
582 endnum := datstl.Count;
583 end else if count <= 0 then begin
584 endnum := firstres + 1;
586 endnum := firstres + count -1;
589 for i := firstres to endnum do begin
590 if AnsiPos(FAbonString, datstl.Strings[i-1]) <> 1 then begin
591 datstl.Strings[i-1] := FAbonString + datstl.Strings[i-1];
595 datstl.SaveToFile(datfilepath);
604 //DAT
\82ð
\92¼
\82É
\82¢
\82¶
\82é
\93z
\82ç==========
\82±
\82±
\82Ü
\82Å=========================================
606 //
\8c³
\82É
\96ß
\82·
\93z
\82ç==================================================================
607 function TAbon.ReverseExecuteFile(datfilepath : String) : Boolean; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
609 datstl : TStringList;
615 datstl := TStringList.Create;
618 datstl.LoadFromFile(datfilepath);
619 for i:=0 to datstl.Count -1 do begin
620 if AnsiPos(FAbonString, datstl.Strings[i]) = 1 then begin
621 buf := datstl.Strings[i];
622 Delete(buf,1,Length(FAbonString));
623 datstl.Strings[i] := buf;
626 datstl.SaveToFile(datfilepath);
636 function TAbon.ReverseExecuteFile(datfilepath : String; resnum : Integer) : Boolean; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
638 datstl : TStringList;
643 datstl := TStringList.Create;
646 datstl.LoadFromFile(datfilepath);
647 if (resnum > 0) and (resnum <= datstl.Count) then begin
648 if AnsiPos(FAbonString, datstl.Strings[resnum-1]) = 1 then begin
649 buf := datstl.Strings[resnum-1];
650 Delete(buf,1,Length(FAbonString));
651 datstl.Strings[resnum-1] := buf;
654 datstl.SaveToFile(datfilepath);
664 function TAbon.ReverseExecuteFile(datfilepath : String; firstres : Integer; count : Integer) : Boolean;//DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
666 datstl : TStringList;
668 endnum : Integer; //
\8fI
\82í
\82è
\82Ì
\83\8c\83X
\94Ô
673 datstl := TStringList.Create;
676 datstl.LoadFromFile(datfilepath);
677 if (firstres > 0) and (firstres <= datstl.Count) then begin
678 if firstres + count -1 > datstl.Count then begin
679 endnum := datstl.Count;
680 end else if count <= 0 then begin
681 endnum := firstres + 1;
683 endnum := firstres + count -1;
685 for i := firstres to endnum do begin
686 if AnsiPos(FAbonString, datstl.Strings[i-1]) = 1 then begin
687 buf := datstl.Strings[i-1];
688 Delete(buf,1,Length(FAbonString));
689 datstl.Strings[i-1] := buf;
693 datstl.SaveToFile(datfilepath);
702 //
\8c³
\82É
\96ß
\82·
\93z
\82ç=================
\82±
\82±
\82Ü
\82Å=========================================
703 //
\8c»
\8dÝ
\83Z
\83b
\83g
\82³
\82ê
\82Ä
\82¢
\82éNGword.txt
\82ð
\8aJ
\82
704 procedure TAbon.EditNGwords();
706 ShellExecute(0 ,nil,PChar(FNGwordpath),nil,nil,SW_SHOW);
708 //
\83|
\83b
\83v
\83A
\83b
\83v
\97p
\94»
\92è
\8aÖ
\90\94
709 function TAbon.CheckAbonPopupRes(line : String) :Boolean;
711 if AbonPopupRes = true then begin
712 Result := FindNGwords(line);
717 //
\95¡
\90\94\82ÌNG
\83\8f\81[
\83h
\83e
\83L
\83X
\83g
\82ð
\93Ç
\82Ý
\8d\9e\82Þ==============================================
718 //List
\83t
\83@
\83C
\83\8b\82ð
\93Ç
\82Ý
\8d\9e\82Þ
719 function TAbon.LoadListFile(path :String; listStringList : TStringList) : Boolean;
722 listStringList.LoadFromFile(path);
725 listStringList.Append('
\88ê
\94Ê=NGword.txt');
726 listStringList.SaveToFile(path);
730 //List
\82Ì
\88ê
\82Â
\8e\9f\82ÌNG
\83\8f\81[
\83h
\83t
\83@
\83C
\83\8b\82ð
\93Ç
\82Ý
\8d\9e\82Þ
731 function TAbon.GoForward() : Boolean;
733 FNGwordFileIndex := FNGwordFileIndex + 1;
734 Result := ReadNGwordslist(FNGwordFileIndex);
736 //List
\82Ì
\88ê
\82Â
\91O
\82ÌNG
\83\8f\81[
\83h
\83t
\83@
\83C
\83\8b\82ð
\93Ç
\82Ý
\8d\9e\82Þ
737 function TAbon.GoBack() : Boolean;
739 FNGwordFileIndex := FNGwordFileIndex -1;
740 Result := ReadNGwordslist(FNGwordFileIndex);
742 //List
\82Ì
\82P
\8ds
\96Ú
\82ð
\93Ç
\82Þ
743 procedure TAbon.GoHome();
745 FNGwordFileIndex := 0;
746 ReadNGwordslist(FNGwordFileIndex);
748 //List
\82Ìline
\8ds
\96Ú
\82ð
\93Ç
\82Þ
749 function TAbon.ReadNGwordslist(line : Integer) : Boolean;
751 liststl : TStringList;
754 liststl := TStringList.Create;
756 if LoadListFile(Flistpath,liststl) = true then begin
757 if line < 0 then begin
758 line := liststl.Count - 1;
759 FNGwordFileIndex := liststl.Count - 1;
760 end else if line > liststl.Count - 1 then begin
762 FNGwordFileIndex := 0;
764 linebuf := liststl.Strings[line];
765 FNGwordname := Copy(linebuf,1,AnsiPos('=',linebuf)-1);
766 Delete(linebuf,1,AnsiPos('=',linebuf));
767 SetNGwordpath(linebuf);
777 //
\95¡
\90\94\82ÌNG
\83\8f\81[
\83h
\83e
\83L
\83X
\83g
\82ð
\93Ç
\82Ý
\8d\9e\82Þ=====
\82±
\82±
\82Ü
\82Å=================================
778 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\8eÀ
\8ds
\8aÖ
\90\94
779 procedure TAbon.IndividualAbon(var ThreadStrings : TStringList; SetResNumFile : String);
783 if FileExists(SetResNumFile) = true then begin
784 if LoadFromSetResNumFile(SetResNumFile) = true then begin
785 for i := 0 to High(FAbonRes) do begin
786 if (FAbonRes[i].Res <= ThreadStrings.Count) and (FAbonRes[i].Res > 0) then begin
787 if FAbonRes[i].option = 0 then begin
788 ThreadStrings.Strings[FAbonRes[i].Res-1] := '';
790 ThreadStrings.Strings[FAbonRes[i].Res-1] := '
\82 \82Ú
\81`
\82ñ<>
\82 \82Ú
\81`
\82ñ<>
\82 \82Ú
\81`
\82ñ<>
\82 \82Ú
\81`
\82ñ<>';
797 FIndividualFileName := SetResNumFile;
798 SetLength(FAbonRes,1);
799 FAbonRes[0].Res := 0;
800 FAbonRes[0].option := -1;
803 procedure TAbon.IndividualAbon(var ResString : String; SetResNumFile : String; ResNumber : Integer);
807 if FileExists(SetResNumFile) = true then begin
808 if LoadFromSetResNumFile(SetResNumFile) = true then begin
809 for i := 0 to High(FAbonRes) do begin
810 if FAbonRes[i].Res = ResNumber then begin
811 if FAbonRes[i].option = 0 then begin
814 ResString := '
\82 \82Ú
\81`
\82ñ<>
\82 \82Ú
\81`
\82ñ<>
\82 \82Ú
\81`
\82ñ<>
\82 \82Ú
\81`
\82ñ<>';
821 FIndividualFileName := SetResNumFile;
822 SetLength(FAbonRes,1);
823 FAbonRes[0].Res := 0;
824 FAbonRes[0].option := -1;
828 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\83t
\83@
\83C
\83\8b\93Ç
\82Ý
\8d\9e\82Ý
\8aÖ
\90\94
829 function TAbon.LoadFromSetResNumFile(SetResNumFile : String) : Boolean;
831 bufStringList : TStringList;
835 bufStringList := TStringList.Create;
838 bufStringList.LoadFromFile(SetResNumFile);
839 FIndividualFileName := SetResNumFile;
841 for i := bufStringList.Count-1 downto 0 do begin
842 if bufStringList.Strings[i] = '' then begin
843 bufStringList.Delete(i);
847 //
\83\81\83\82\83\8a\8am
\95Û
848 SetLength(FAbonRes,bufStringList.Count);
850 for i :=0 to bufStringList.Count - 1 do begin
851 bufLine := Trim(bufStringList.Strings[i]);
852 FAbonRes[i].Res := StrToInt(Copy(bufLine,1,AnsiPos('-',bufLine)-1));
853 FAbonRes[i].option := StrToInt(Copy(bufLine,AnsiPos('-',bufLine)+1,1));
864 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\83t
\83@
\83C
\83\8b\82É
\92Ç
\89Á
865 procedure TAbon.AddIndividualAbon( ResNum : Integer ; option : Integer);
867 IndividualFile : TStringList;
871 IndividualFile := TStringList.Create;
872 if FAbonRes[0].Res <> 0 then begin
873 for i := 0 to High(FAbonRes) do begin
874 if FAbonRes[i].Res <> ResNum then begin
875 linebuf := IntToStr(FAbonRes[i].Res) + '-' + IntToStr(FabonRes[i].option);
876 IndividualFile.Append(linebuf);
880 linebuf := IntToStr(ResNum) + '-' + IntToStr(option);
881 IndividualFile.Append(linebuf);
883 IndividualFile.SaveToFile(FIndividualFileName);
888 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\83t
\83@
\83C
\83\8b\82©
\82ç
\8dí
\8f\9c
889 procedure TAbon.DeleteIndividualAbon( ResNum : Integer);
891 IndividualFile : TStringList;
895 IndividualFile := TStringList.Create;
896 if FAbonRes[0].Res <> 0 then begin
897 for i := 0 to High(FAbonRes) do begin
898 if FAbonRes[i].Res <> ResNum then begin
899 linebuf := IntToStr(FAbonRes[i].Res) + '-' + IntToStr(FabonRes[i].option);
900 IndividualFile.Append(linebuf);
904 if IndividualFile.Count <> 0 then begin
906 IndividualFile.SaveToFile(FIndividualFileName);
911 if FileExists(FIndividualFileName) = true then begin
912 DeleteFile(FIndividualFileName);
916 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\82Ì
\83\8a\83X
\83g
\82Ì
\8cÂ
\90\94\82ð
\95Ô
\82·
917 function TAbon.GetAbonResCount() : Integer;
921 if FAbonRes[0].Res = 0 then begin
928 //
\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·
929 function TAbon.GetAbonResString(Num : Integer) : String;
931 if (Num <= High(FAbonRes)) and (Num >= 0) then begin
932 Result := IntToStr(FAbonRes[Num].Res);
937 //
\83|
\83b
\83v
\83A
\83b
\83v
\82Ì
\94»
\92è
\97p
938 function TAbon.CheckIndividualAbonList(ResNum : Integer) : Boolean;
942 if FAbonRes[0].Res <> 0 then begin
943 for i := 0 to High(FAbonRes) do begin
944 if FAbonRes[i].Res = ResNum then begin