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 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\82µ
\82å
\82è
73 procedure IndividualAbon(var ThreadStrings : TStringList; SetResNumFile : String);
74 procedure AddIndividualAbon( ResNum : Integer ; option : Integer);
75 procedure DeleteIndividualAbon( ResNum : Integer);
76 function GetAbonResCount() : Integer;
77 function GetAbonResString(Num : Integer) : String;
78 function CheckIndividualAbonList(ResNum : Integer) : Boolean;
80 function ExecuteFile(datfilepath : String; NGwordpath : String) : Boolean; overload;//DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
81 function ExecuteFile(datfilepath : String; resnum : Integer) : Boolean; overload; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
82 function ExecuteFile(datfilepath : String; firstres : Integer; count : Integer) : Boolean; overload; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
83 function ReverseExecuteFile(datfilepath : String) : Boolean; overload; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
84 function ReverseExecuteFile(datfilepath : String; resnum : Integer) : Boolean; overload; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
85 function ReverseExecuteFile(datfilepath : String; firstres : Integer; count : Integer) : Boolean; overload; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
87 procedure EditNGwords(); //NGword.txt
\82ð
\8aJ
\82
\81B
88 function ShowAllTokens() : String; //
\83f
\83o
\83b
\83O
\97p
90 procedure GoHome();//List
\82Ì
\82P
\8ds
\96Ú
\82ð
\93Ç
\82Þ
91 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Þ
92 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Þ
97 NGwordListFileName : String = 'NGwords.list';
101 constructor TAbon.Create;
104 FAbonString := ' <> <> <> <><>';
105 FCreateNGwordFile := true;
106 SetLength(FAbonRes,1);
107 FAbonRes[0].Res := 0;
108 FAbonRes[0].option := -1;
112 destructor TAbon.Destroy;
116 //root
\82ÍExe\config\NGwords
\83t
\83H
\83\8b\83_
117 procedure TAbon.Setroot(root :String);
119 bufStringList : TStringList;
121 bufStringList := TStringList.Create;
123 if not DirectoryExists(root) then begin
126 if root[Length(root)] <> '\' then begin
129 Flistpath := root + NGwordListFileName;
130 LoadListFile(Flistpath, bufStringList);
136 function TAbon.Getroot() : String;
140 //NGwordpath
\82ÍNGword.txt
\82Ì
\83t
\83\8b\83p
\83X
141 procedure TAbon.SetNGwordpath(path :String);
143 FNGwordpath := Getfullpath(path);
144 LoadFromNGwordFile(FNGwordpath);
146 function TAbon.GetNGwordpath() : String;
148 Result := FNGwordpath;
150 //
\83t
\83\8b\83p
\83X
\82Å
\82È
\82¯
\82ê
\82Î
\83t
\83\8b\83p
\83X
\82É
\82µ
\82Ä
\95Ô
\82·
\81B
151 function TAbon.Getfullpath(argpath : String) : String;
153 if AnsiPos(':\',argpath) <> 2 then begin //
\83h
\83\89\83C
\83u
\82©
\82ç
\82Ì
\83t
\83\8b\83p
\83X
\82ª
\96³
\82¯
\82ê
\82Î
154 if Getroot() = '' then begin
155 Result := ''; //root
\83p
\83X
\82ª
\90Ý
\92è
\82³
\82ê
\82Ä
\82È
\82¢
\82©
\8bó
\82É
\82·
\82é
157 if (Froot[Length(Froot)] = '\') and (argpath[1] = '\') then begin //
\90æ
\93ª
\82Ì\
\82ð
\8dí
\8f\9c
160 Insert( Getroot(), argpath , 1);//root
\83p
\83X
\82ð
\91}
\93ü
168 //NGword
\83t
\83@
\83C
\83\8b\82Ì
\93Ç
\82Ý
\8d\9e\82Ý
169 function TAbon.LoadFromNGwordFile(path :String) : boolean;
171 bufstl : TStringList;
173 path := Getfullpath(path);
174 if path = '' then begin
177 bufstl := TStringList.Create;
180 bufstl.LoadFromFile(path);
181 LoadFromStringList( bufstl );
184 if CreateNGwordFile = true then begin
185 bufstl.SaveToFile(path);
195 //NGword
\83\8a\83X
\83g
\93Ç
\82Ý
\8d\9e\82Ý
196 procedure TAbon.LoadFromStringList( bufstl : TStringList );
201 for i := bufstl.Count -1 downto 0 do begin
202 if bufstl.Strings[i] = '' then begin
206 SetLength(Ftokens,bufstl.Count);
207 for i := 0 to bufstl.Count -1 do begin
208 SetTokens(i , bufstl.Strings[i]);
215 //NGwordpath
\82ª
\8aù
\82É
\90Ý
\92è
\82³
\82ê
\82Ä
\82¢
\82é
\82Æ
\82«
\82Ì
\83\8a\83\8d\81[
\83h
\97p
\8aÖ
\90\94
216 function TAbon.ReLoadFromNGwordFile() : boolean;
218 if GetNGwordpath() ='' then begin
221 Result := LoadFromNGwordFile( GetNGwordpath() );
224 function TAbon.Getlistpath() : String;
228 procedure TAbon.Setlistpath(const Value : String);
230 Flistpath := Getfullpath(Value);
232 //
\88ê
\8ds
\82Ì
\92\86\82Ì
\83g
\81[
\83N
\83\93\82ð
\90Ø
\82è
\95ª
\82¯
\82Ä
\83Z
\83b
\83g
233 procedure TAbon.SetTokens(index: integer ; argline : String);
236 bufstl : TStringList;
242 bufstl := TStringList.Create;
244 if Length(argline) > 0 then begin
245 pos := AnsiPos(#9,argline);
246 while pos <> 0 DO begin
247 buftoken := Copy(argline,1,pos-1);
248 Delete(argline,1,pos);
249 if Length(buftoken) > 0 then begin
250 bufstl.Append(buftoken);
251 end else if ( bufstl.Count = 0 ) then begin
254 pos := AnsiPos(#9,argline);
256 if Length(argline) > 0 then begin
257 bufstl.Append(argline);
260 SetLength(Ftokens[index],ret);
261 for i := 0 to bufstl.Count - 1 do begin
262 Ftokens[index][i] := bufstl.Strings[i];
270 //Debug
\97p
\82¿
\82á
\82ñ
\82ÆNG
\83\8f\81[
\83h
\82ð
\8fE
\82¦
\82Ä
\82¢
\82é
\82©
271 function TAbon.ShowAllTokens() : String;
277 for i := 0 to High(Ftokens) do begin
278 for j := 0 to High(Ftokens[i]) do begin
279 ret := ret + Ftokens[i][j];
288 //****************************************************************************//
289 //NG
\83\8f\81[
\83h
\82ª
\8aÜ
\82Ü
\82ê
\82Ä
\82½
\82çtrue
\82ð
\95Ô
\82·
\81B
290 function TAbon.FindNGwords(line : String) : Boolean;
298 if AnsiPos(FAbonString,line) <> 1 then begin
299 for lines := 0 to High(Ftokens) do begin
302 for cells := 0 to High(Ftokens[lines]) do begin
303 if AnsiPos(Ftokens[lines][cells],bufline) = 0 then begin
307 Delete(bufline,AnsiPos(Ftokens[lines][cells],bufline),Length(Ftokens[lines][cells]));
310 if hit = true then begin
317 //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·
318 function TAbon.FindNGwords(line : String; var NGwordsLineNum : Integer) : Boolean;
326 if AnsiPos(FAbonString,line) <> 1 then begin
327 for lines := 0 to High(Ftokens) do begin
330 for cells := 0 to High(Ftokens[lines]) do begin
331 if AnsiPos(Ftokens[lines][cells],bufline) = 0 then begin
335 Delete(bufline,AnsiPos(Ftokens[lines][cells],bufline),Length(Ftokens[lines][cells]));
338 if hit = true then begin
339 NGwordsLineNum := lines + 1;
346 //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
347 //
\82à
\82µ
\82à
\93§
\96¾
\82 \82Ú
\81`
\82ñ
\82É
\82·
\82é
\82È
\82çInbisible
\82ðtrue
\82É
\82µ
\82Ä
\95Ô
\82·
348 function TAbon.FindNGwords(line : String; var NGwordsLineNum : Integer; var Invisible : Boolean) : Boolean; //1
\83\89\83C
\83\93\82¸
\82Â
\97p
\81B
357 if AnsiPos(FAbonString,line) <> 1 then begin
358 for lines := 0 to High(Ftokens) do begin
361 if Ftokens[lines][0] <> '' then begin
369 for cells := start to High(Ftokens[lines]) do begin
370 if AnsiPos(Ftokens[lines][cells],bufline) = 0 then begin
374 Delete(bufline,AnsiPos(Ftokens[lines][cells],bufline),Length(Ftokens[lines][cells]));
377 if hit = true then begin
378 NGwordsLineNum := lines + 1;
386 //CutOff
\92l
\88È
\8fã
\8cÂ
\82Ì
\93¯
\82¶
\89p
\90\94\82ª
\95À
\82ñ
\82Å
\82¢
\82½
\82çtrue
387 function TAbon.Cutoff(line : String) : Boolean;
395 if FCutoffNum <> 0 then begin
396 for i := 65 to 90 do begin
398 buf := DupeString(sheed, FCutoffNum);
399 if AnsiContainsText(line, buf) = true then begin
407 //
\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
408 procedure TAbon.Execute(var ThreadStrings : TStringList);
411 NGwordsLine : Integer;
417 if not ReturnNGwordLineNum then begin
418 //if ReturnNGwordLineNum then begin
419 for i:=0 to ThreadStrings.Count - 1 do begin
420 if FindNGwords(ThreadStrings.Strings[i]) <> Reverse then begin
421 if not SetNGResAnchor then
422 ThreadStrings.Strings[i] := FAbonString
424 ThreadStrings.Strings[i] := Format(' <> <> <>>%d<><>',[(i+1)]);
426 bufline := ThreadStrings.Strings[i];
427 if Deleterlo = true then begin
428 bufline := AnsiReplaceText( bufline,'&rlo;','' );
429 bufline := AnsiReplaceText( bufline,'&lro;','' );
431 if Replaceul = true then begin
432 bufline := AnsiReplaceText( bufline,'<ul>','<br>' );
433 bufline := AnsiReplaceText( bufline,'</ul>','<br>' );
435 ThreadStrings.Strings[i] := bufline;
440 for i:=0 to ThreadStrings.Count - 1 do begin
442 if FindNGwords(ThreadStrings.Strings[i], NGwordsLine ,invisi) <> Reverse then begin
443 if invisi = true then begin
444 ThreadStrings.Strings[i] := '';
446 if not ReturnNGwordLineNum and not SetNGResAnchor then begin
447 ThreadStrings.Strings[i] := FAbonString;
448 end else if not ReturnNGwordLineNum then begin
449 ThreadStrings.Strings[i] := Format(' <> <> <>>%d<><>',[(i+1)]);
450 end else if not SetNGResAnchor then begin
451 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]);
453 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)]);
458 if not SetNGResAnchor then
459 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])
461 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)]);
464 bufline := ThreadStrings.Strings[i];
465 if Deleterlo = true then begin
466 bufline := AnsiReplaceText( bufline,'&rlo;','' );
467 bufline := AnsiReplaceText( bufline,'&lro;','' );
469 if Replaceul = true then begin
470 bufline := AnsiReplaceText( bufline,'<ul>','<br>' );
471 bufline := AnsiReplaceText( bufline,'</ul>','<br>' );
473 ThreadStrings.Strings[i] := bufline;
480 procedure TAbon.Execute(var ThreadStrings : TStringList; NGwords : TStringList);
484 SetLength(Ftokens,NGwords.Count);
485 for i := 0 to NGwords.Count -1 do begin
486 SetTokens(i , NGwords.Strings[i]);
488 Execute(ThreadStrings);
491 procedure TAbon.Execute(var ThreadStrings : TStringList; NGwords : TStrings);
496 buf := TStringList.Create;
497 buf.AddStrings(NGwords);
498 SetLength(Ftokens,buf.Count);
499 for i := 0 to buf.Count -1 do begin
500 SetTokens(i , buf.Strings[i]);
502 Execute(ThreadStrings);
507 //****************************************************************************//
508 //DAT
\82ð
\92¼
\82É
\82¢
\82¶
\82é
\93z
\82ç===========================================================
509 //NG
\83\8f\81[
\83h
\82ð
\8aÜ
\82Þ
\83\8c\83X
\82Ì
\90æ
\93ª
\82É
\82 \82Ú
\81[
\82ñ
\82ð
\91}
\93ü
510 function TAbon.ExecuteFile(datfilepath : String; NGwordpath : String) : Boolean; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
512 datstl : TStringList;
516 datstl := TStringList.Create;
520 datstl.LoadFromFile(datfilepath);
521 for i := 0 to datstl.Count -1 do begin
522 if FindNGwords(datstl.Strings[i]) = true then begin
523 datstl.Strings[i] := FAbonString + datstl.Strings[i]
527 datstl.SaveToFile(datfilepath);
537 //
\8ew
\92è
\82³
\82ê
\82½
\83\8c\83X
\94Ô
\82Ì
\90æ
\93ª
\82É
\82 \82Ú
\81[
\82ñ
\91}
\93ü
538 function TAbon.ExecuteFile(datfilepath : String; resnum : Integer) : Boolean; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
540 datstl : TStringList;
544 datstl := TStringList.Create;
547 datstl.LoadFromFile(datfilepath);
548 if (resnum > 0) and (resnum <= datstl.Count) then begin
549 if AnsiPos(FAbonString, datstl.Strings[resnum-1]) <> 1 then begin
550 datstl.Strings[resnum-1] := FAbonString + datstl.Strings[resnum-1];
553 datstl.SaveToFile(datfilepath);
562 //firstres
\82©
\82çcount
\8cÂ
\82Ì
\83\8c\83X
\82Ì
\90æ
\93ª
\82É
\82 \82Ú
\81[
\82ñ
\91}
\93ü
563 function TAbon.ExecuteFile(datfilepath : String; firstres : Integer; count : Integer) : Boolean; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
565 datstl : TStringList;
567 endnum : Integer; //
\8fI
\82í
\82è
\82Ì
\83\8c\83X
\94Ô
571 datstl := TStringList.Create;
574 datstl.LoadFromFile(datfilepath);
575 if (firstres > 0) and (firstres <= datstl.Count) then begin
576 if firstres + count -1 > datstl.Count then begin
577 endnum := datstl.Count;
578 end else if count <= 0 then begin
579 endnum := firstres + 1;
581 endnum := firstres + count -1;
584 for i := firstres to endnum do begin
585 if AnsiPos(FAbonString, datstl.Strings[i-1]) <> 1 then begin
586 datstl.Strings[i-1] := FAbonString + datstl.Strings[i-1];
590 datstl.SaveToFile(datfilepath);
599 //DAT
\82ð
\92¼
\82É
\82¢
\82¶
\82é
\93z
\82ç==========
\82±
\82±
\82Ü
\82Å=========================================
601 //
\8c³
\82É
\96ß
\82·
\93z
\82ç==================================================================
602 function TAbon.ReverseExecuteFile(datfilepath : String) : Boolean; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
604 datstl : TStringList;
610 datstl := TStringList.Create;
613 datstl.LoadFromFile(datfilepath);
614 for i:=0 to datstl.Count -1 do begin
615 if AnsiPos(FAbonString, datstl.Strings[i]) = 1 then begin
616 buf := datstl.Strings[i];
617 Delete(buf,1,Length(FAbonString));
618 datstl.Strings[i] := buf;
621 datstl.SaveToFile(datfilepath);
631 function TAbon.ReverseExecuteFile(datfilepath : String; resnum : Integer) : Boolean; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
633 datstl : TStringList;
638 datstl := TStringList.Create;
641 datstl.LoadFromFile(datfilepath);
642 if (resnum > 0) and (resnum <= datstl.Count) then begin
643 if AnsiPos(FAbonString, datstl.Strings[resnum-1]) = 1 then begin
644 buf := datstl.Strings[resnum-1];
645 Delete(buf,1,Length(FAbonString));
646 datstl.Strings[resnum-1] := buf;
649 datstl.SaveToFile(datfilepath);
659 function TAbon.ReverseExecuteFile(datfilepath : String; firstres : Integer; count : Integer) : Boolean;//DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
661 datstl : TStringList;
663 endnum : Integer; //
\8fI
\82í
\82è
\82Ì
\83\8c\83X
\94Ô
668 datstl := TStringList.Create;
671 datstl.LoadFromFile(datfilepath);
672 if (firstres > 0) and (firstres <= datstl.Count) then begin
673 if firstres + count -1 > datstl.Count then begin
674 endnum := datstl.Count;
675 end else if count <= 0 then begin
676 endnum := firstres + 1;
678 endnum := firstres + count -1;
680 for i := firstres to endnum do begin
681 if AnsiPos(FAbonString, datstl.Strings[i-1]) = 1 then begin
682 buf := datstl.Strings[i-1];
683 Delete(buf,1,Length(FAbonString));
684 datstl.Strings[i-1] := buf;
688 datstl.SaveToFile(datfilepath);
697 //
\8c³
\82É
\96ß
\82·
\93z
\82ç=================
\82±
\82±
\82Ü
\82Å=========================================
698 //
\8c»
\8dÝ
\83Z
\83b
\83g
\82³
\82ê
\82Ä
\82¢
\82éNGword.txt
\82ð
\8aJ
\82
699 procedure TAbon.EditNGwords();
701 ShellExecute(0 ,nil,PChar(FNGwordpath),nil,nil,SW_SHOW);
703 //
\83|
\83b
\83v
\83A
\83b
\83v
\97p
\94»
\92è
\8aÖ
\90\94
704 function TAbon.CheckAbonPopupRes(line : String) :Boolean;
706 if AbonPopupRes = true then begin
707 Result := FindNGwords(line);
712 //
\95¡
\90\94\82ÌNG
\83\8f\81[
\83h
\83e
\83L
\83X
\83g
\82ð
\93Ç
\82Ý
\8d\9e\82Þ==============================================
713 //List
\83t
\83@
\83C
\83\8b\82ð
\93Ç
\82Ý
\8d\9e\82Þ
714 function TAbon.LoadListFile(path :String; listStringList : TStringList) : Boolean;
717 listStringList.LoadFromFile(path);
720 listStringList.Append('
\88ê
\94Ê=NGword.txt');
721 listStringList.SaveToFile(path);
725 //List
\82Ì
\88ê
\82Â
\8e\9f\82ÌNG
\83\8f\81[
\83h
\83t
\83@
\83C
\83\8b\82ð
\93Ç
\82Ý
\8d\9e\82Þ
726 function TAbon.GoForward() : Boolean;
728 FNGwordFileIndex := FNGwordFileIndex + 1;
729 Result := ReadNGwordslist(FNGwordFileIndex);
731 //List
\82Ì
\88ê
\82Â
\91O
\82ÌNG
\83\8f\81[
\83h
\83t
\83@
\83C
\83\8b\82ð
\93Ç
\82Ý
\8d\9e\82Þ
732 function TAbon.GoBack() : Boolean;
734 FNGwordFileIndex := FNGwordFileIndex -1;
735 Result := ReadNGwordslist(FNGwordFileIndex);
737 //List
\82Ì
\82P
\8ds
\96Ú
\82ð
\93Ç
\82Þ
738 procedure TAbon.GoHome();
740 FNGwordFileIndex := 0;
741 ReadNGwordslist(FNGwordFileIndex);
743 //List
\82Ìline
\8ds
\96Ú
\82ð
\93Ç
\82Þ
744 function TAbon.ReadNGwordslist(line : Integer) : Boolean;
746 liststl : TStringList;
749 liststl := TStringList.Create;
751 if LoadListFile(Flistpath,liststl) = true then begin
752 if line < 0 then begin
753 line := liststl.Count - 1;
754 FNGwordFileIndex := liststl.Count - 1;
755 end else if line > liststl.Count - 1 then begin
757 FNGwordFileIndex := 0;
759 linebuf := liststl.Strings[line];
760 FNGwordname := Copy(linebuf,1,AnsiPos('=',linebuf)-1);
761 Delete(linebuf,1,AnsiPos('=',linebuf));
762 SetNGwordpath(linebuf);
772 //
\95¡
\90\94\82ÌNG
\83\8f\81[
\83h
\83e
\83L
\83X
\83g
\82ð
\93Ç
\82Ý
\8d\9e\82Þ=====
\82±
\82±
\82Ü
\82Å=================================
773 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\8eÀ
\8ds
\8aÖ
\90\94
774 procedure TAbon.IndividualAbon(var ThreadStrings : TStringList; SetResNumFile : String);
778 if FileExists(SetResNumFile) = true then begin
779 if LoadFromSetResNumFile(SetResNumFile) = true then begin
780 for i := 0 to High(FAbonRes) do begin
781 if (FAbonRes[i].Res <= ThreadStrings.Count) and (FAbonRes[i].Res > 0) then begin
782 if FAbonRes[i].option = 0 then begin
783 ThreadStrings.Strings[FAbonRes[i].Res-1] := '';
785 ThreadStrings.Strings[FAbonRes[i].Res-1] := '
\82 \82Ú
\81`
\82ñ<>
\82 \82Ú
\81`
\82ñ<>
\82 \82Ú
\81`
\82ñ<>
\82 \82Ú
\81`
\82ñ<>';
792 FIndividualFileName := SetResNumFile;
793 SetLength(FAbonRes,1);
794 FAbonRes[0].Res := 0;
795 FAbonRes[0].option := -1;
798 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\83t
\83@
\83C
\83\8b\93Ç
\82Ý
\8d\9e\82Ý
\8aÖ
\90\94
799 function TAbon.LoadFromSetResNumFile(SetResNumFile : String) : Boolean;
801 bufStringList : TStringList;
805 bufStringList := TStringList.Create;
808 bufStringList.LoadFromFile(SetResNumFile);
809 FIndividualFileName := SetResNumFile;
811 for i := bufStringList.Count-1 downto 0 do begin
812 if bufStringList.Strings[i] = '' then begin
813 bufStringList.Delete(i);
817 //
\83\81\83\82\83\8a\8am
\95Û
818 SetLength(FAbonRes,bufStringList.Count);
820 for i :=0 to bufStringList.Count - 1 do begin
821 bufLine := Trim(bufStringList.Strings[i]);
822 FAbonRes[i].Res := StrToInt(Copy(bufLine,1,AnsiPos('-',bufLine)-1));
823 FAbonRes[i].option := StrToInt(Copy(bufLine,AnsiPos('-',bufLine)+1,1));
834 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\83t
\83@
\83C
\83\8b\82É
\92Ç
\89Á
835 procedure TAbon.AddIndividualAbon( ResNum : Integer ; option : Integer);
837 IndividualFile : TStringList;
841 IndividualFile := TStringList.Create;
842 if FAbonRes[0].Res <> 0 then begin
843 for i := 0 to High(FAbonRes) do begin
844 if FAbonRes[i].Res <> ResNum then begin
845 linebuf := IntToStr(FAbonRes[i].Res) + '-' + IntToStr(FabonRes[i].option);
846 IndividualFile.Append(linebuf);
850 linebuf := IntToStr(ResNum) + '-' + IntToStr(option);
851 IndividualFile.Append(linebuf);
853 IndividualFile.SaveToFile(FIndividualFileName);
858 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\83t
\83@
\83C
\83\8b\82©
\82ç
\8dí
\8f\9c
859 procedure TAbon.DeleteIndividualAbon( ResNum : Integer);
861 IndividualFile : TStringList;
865 IndividualFile := TStringList.Create;
866 if FAbonRes[0].Res <> 0 then begin
867 for i := 0 to High(FAbonRes) do begin
868 if FAbonRes[i].Res <> ResNum then begin
869 linebuf := IntToStr(FAbonRes[i].Res) + '-' + IntToStr(FabonRes[i].option);
870 IndividualFile.Append(linebuf);
874 if IndividualFile.Count <> 0 then begin
876 IndividualFile.SaveToFile(FIndividualFileName);
881 if FileExists(FIndividualFileName) = true then begin
882 DeleteFile(FIndividualFileName);
886 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\82Ì
\83\8a\83X
\83g
\82Ì
\8cÂ
\90\94\82ð
\95Ô
\82·
887 function TAbon.GetAbonResCount() : Integer;
891 if FAbonRes[0].Res = 0 then begin
898 //
\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·
899 function TAbon.GetAbonResString(Num : Integer) : String;
901 if (Num <= High(FAbonRes)) and (Num >= 0) then begin
902 Result := IntToStr(FAbonRes[Num].Res);
907 //
\83|
\83b
\83v
\83A
\83b
\83v
\82Ì
\94»
\92è
\97p
908 function TAbon.CheckIndividualAbonList(ResNum : Integer) : Boolean;
912 if FAbonRes[0].Res <> 0 then begin
913 for i := 0 to High(FAbonRes) do begin
914 if FAbonRes[i].Res = ResNum then begin