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 FDeleteSyria: Boolean; //
\83V
\83\8a\83A
\8cê
\83u
\83\89\83N
\83\89\91Î
\8dô
\81i܀~ݏ
\81j
34 procedure SetTokens(index: integer ; argline:String);
35 function Getlistpath() : String;
36 procedure Setlistpath(const Value : String);
37 function LoadListFile(path :String;listStringList : TStringList) : Boolean;
38 function ReadNGwordslist(line : Integer) : Boolean;
39 function LoadFromSetResNumFile(SetResNumFile : String) : Boolean;
42 constructor Create; //
\83R
\83\93\83X
\83g
\83\89\83N
\83^
43 destructor Destroy; override; //
\83f
\83X
\83g
\83\89\83N
\83^
44 property Deleterlo: Boolean read FDeleterlo write FDeleterlo default false;
45 property Replaceul: Boolean read FReplaceul write FReplaceul default false;
46 property Reverse: Boolean read FReverse write FReverse default false;
47 property CreateNGwordFile: Boolean read FCreateNGwordFile write FCreateNGwordFile;
48 property AbonString : String read FAbonString write FAbonString;
49 property AbonPopupRes : Boolean read FAbonPopupRes write FAbonPopupRes default false;
50 property listpath : String read Getlistpath write Setlistpath;
51 property NGwordFileIndex : Integer read FNGwordFileIndex write FNGwordFileIndex default 0;
52 property NGwordname : String read FNGwordname write FNGwordname;
53 property ReturnNGwordLineNum : Boolean read FReturnNGwordLineNum write FReturnNGwordLineNum default false;
54 property SetNGResAnchor : Boolean read FSetNGResAnchor write FSetNGResAnchor default false;
55 property DeleteSyria : Boolean read FDeleteSyria write FDeleteSyria default false;
56 procedure Setroot(root :String);
57 function Getroot() : String;
59 function Getfullpath(argpath : String) : String;
60 procedure SetNGwordpath(path :String);
61 function GetNGwordpath() : String;
62 function LoadFromNGwordFile(path :String) : Boolean;
63 function ReLoadFromNGwordFile() : Boolean;
64 procedure LoadFromStringList( bufstl : TStringList );
65 function CheckAbonPopupRes(line : String) :Boolean;
66 function FindNGwords(const line : String; var NGwordsLineNum : Integer; var Invisible : Boolean) : Boolean;//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 procedure EditNGwords(); //NGword.txt
\82ð
\8aJ
\82
\81B
83 function ShowAllTokens() : String; //
\83f
\83o
\83b
\83O
\97p
85 procedure GoHome();//List
\82Ì
\82P
\8ds
\96Ú
\82ð
\93Ç
\82Þ
86 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Þ
87 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Þ
89 function TreatSyria(AString: string): string;
94 NGwordListFileName : String = 'NGwords.list';
100 constructor TAbon.Create;
103 FAbonString := ' <> <> <> <><>';
104 FCreateNGwordFile := true;
105 SetLength(FAbonRes,1);
106 FAbonRes[0].Res := 0;
107 FAbonRes[0].option := -1;
111 destructor TAbon.Destroy;
115 //root
\82ÍExe\config\NGwords
\83t
\83H
\83\8b\83_
116 procedure TAbon.Setroot(root :String);
118 bufStringList : TStringList;
120 bufStringList := TStringList.Create;
122 if not DirectoryExists(root) then begin
125 if root[Length(root)] <> '\' then begin
128 Flistpath := root + NGwordListFileName;
129 LoadListFile(Flistpath, bufStringList);
135 function TAbon.Getroot() : String;
139 //NGwordpath
\82ÍNGword.txt
\82Ì
\83t
\83\8b\83p
\83X
140 procedure TAbon.SetNGwordpath(path :String);
142 FNGwordpath := Getfullpath(path);
143 LoadFromNGwordFile(FNGwordpath);
145 function TAbon.GetNGwordpath() : String;
147 Result := FNGwordpath;
149 //
\83t
\83\8b\83p
\83X
\82Å
\82È
\82¯
\82ê
\82Î
\83t
\83\8b\83p
\83X
\82É
\82µ
\82Ä
\95Ô
\82·
\81B
150 function TAbon.Getfullpath(argpath : String) : String;
152 if AnsiPos(':\',argpath) <> 2 then begin //
\83h
\83\89\83C
\83u
\82©
\82ç
\82Ì
\83t
\83\8b\83p
\83X
\82ª
\96³
\82¯
\82ê
\82Î
153 if Getroot() = '' then begin
154 Result := ''; //root
\83p
\83X
\82ª
\90Ý
\92è
\82³
\82ê
\82Ä
\82È
\82¢
\82©
\8bó
\82É
\82·
\82é
156 if (Froot[Length(Froot)] = '\') and (argpath[1] = '\') then begin //
\90æ
\93ª
\82Ì\
\82ð
\8dí
\8f\9c
159 Insert( Getroot(), argpath , 1);//root
\83p
\83X
\82ð
\91}
\93ü
167 //NGword
\83t
\83@
\83C
\83\8b\82Ì
\93Ç
\82Ý
\8d\9e\82Ý
168 function TAbon.LoadFromNGwordFile(path :String) : boolean;
170 bufstl : TStringList;
172 path := Getfullpath(path);
173 if path = '' then begin
176 bufstl := TStringList.Create;
179 bufstl.LoadFromFile(path);
180 LoadFromStringList( bufstl );
183 if CreateNGwordFile = true then begin
184 bufstl.SaveToFile(path);
194 //NGword
\83\8a\83X
\83g
\93Ç
\82Ý
\8d\9e\82Ý
195 procedure TAbon.LoadFromStringList( bufstl : TStringList );
200 for i := bufstl.Count -1 downto 0 do begin
201 if bufstl.Strings[i] = '' then begin
205 SetLength(Ftokens,bufstl.Count);
206 for i := 0 to bufstl.Count -1 do begin
207 SetTokens(i , bufstl.Strings[i]);
214 //NGwordpath
\82ª
\8aù
\82É
\90Ý
\92è
\82³
\82ê
\82Ä
\82¢
\82é
\82Æ
\82«
\82Ì
\83\8a\83\8d\81[
\83h
\97p
\8aÖ
\90\94
215 function TAbon.ReLoadFromNGwordFile() : boolean;
217 if GetNGwordpath() ='' then begin
220 Result := LoadFromNGwordFile( GetNGwordpath() );
223 function TAbon.Getlistpath() : String;
227 procedure TAbon.Setlistpath(const Value : String);
229 Flistpath := Getfullpath(Value);
231 //
\88ê
\8ds
\82Ì
\92\86\82Ì
\83g
\81[
\83N
\83\93\82ð
\90Ø
\82è
\95ª
\82¯
\82Ä
\83Z
\83b
\83g
232 procedure TAbon.SetTokens(index: integer ; argline : String);
235 bufstl : TStringList;
241 bufstl := TStringList.Create;
243 if Length(argline) > 0 then begin
244 pos := AnsiPos(#9,argline);
245 while pos <> 0 DO begin
246 buftoken := Copy(argline,1,pos-1);
247 Delete(argline,1,pos);
248 if Length(buftoken) > 0 then begin
249 bufstl.Append(buftoken);
250 end else if ( bufstl.Count = 0 ) then begin
253 pos := AnsiPos(#9,argline);
255 if Length(argline) > 0 then begin
256 bufstl.Append(argline);
259 SetLength(Ftokens[index],ret);
260 for i := 0 to bufstl.Count - 1 do begin
261 Ftokens[index][i] := bufstl.Strings[i];
269 //Debug
\97p
\82¿
\82á
\82ñ
\82ÆNG
\83\8f\81[
\83h
\82ð
\8fE
\82¦
\82Ä
\82¢
\82é
\82©
270 function TAbon.ShowAllTokens() : String;
276 for i := 0 to High(Ftokens) do begin
277 for j := 0 to High(Ftokens[i]) do begin
278 ret := ret + Ftokens[i][j];
287 //****************************************************************************//
288 //NG
\83\8f\81[
\83h
\82ª
\8aÜ
\82Ü
\82ê
\82Ä
\82½
\82çtrue
\82ð
\95Ô
\82·
\81B
289 {function TAbon.FindNGwords(const 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(const 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;
347 //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
348 //
\82à
\82µ
\82à
\93§
\96¾
\82 \82Ú
\81`
\82ñ
\82É
\82·
\82é
\82È
\82çInbisible
\82ðtrue
\82É
\82µ
\82Ä
\95Ô
\82·
349 function TAbon.FindNGwords(const line : String; var NGwordsLineNum : Integer; var Invisible : Boolean) : Boolean; //1
\83\89\83C
\83\93\82¸
\82Â
\97p
\81B
358 if AnsiPos(FAbonString,line) <> 1 then begin
359 for lines := 0 to High(Ftokens) do begin
362 if Ftokens[lines][0] <> '' then begin
370 for cells := start to High(Ftokens[lines]) do begin
371 if AnsiPos(Ftokens[lines][cells],bufline) = 0 then begin
375 Delete(bufline,AnsiPos(Ftokens[lines][cells],bufline),Length(Ftokens[lines][cells]));
378 if hit = true then begin
379 NGwordsLineNum := lines + 1;
387 //CutOff
\92l
\88È
\8fã
\8cÂ
\82Ì
\93¯
\82¶
\89p
\90\94\82ª
\95À
\82ñ
\82Å
\82¢
\82½
\82çtrue
388 function TAbon.Cutoff(line : String) : Boolean;
396 if FCutoffNum <> 0 then begin
397 for i := 65 to 90 do begin
399 buf := DupeString(sheed, FCutoffNum);
400 if AnsiContainsText(line, buf) = true then begin
408 //
\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
409 procedure TAbon.Execute(var ThreadStrings : TStringList);
412 NGwordsLine : Integer;
416 for i:=0 to ThreadStrings.Count - 1 do begin
418 if FindNGwords(ThreadStrings.Strings[i], NGwordsLine ,invisi) <> Reverse then begin
419 if invisi = true then begin
420 ThreadStrings.Strings[i] := '';
422 if not ReturnNGwordLineNum and not SetNGResAnchor then begin
423 ThreadStrings.Strings[i] := FAbonString;
424 end else if not ReturnNGwordLineNum then begin
425 ThreadStrings.Strings[i] := Format(' <> <> <>>%d<><>',[(i+1)]);
426 end else if not SetNGResAnchor then begin
427 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]);
429 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)]);
433 bufline := ThreadStrings.Strings[i];
434 if Deleterlo = true then begin
435 bufline := CustomStringReplace(bufline,'&rlo;','');
436 bufline := CustomStringReplace(bufline,'&lro;','');
438 if Replaceul = true then begin
439 bufline := CustomStringReplace( bufline,'<ul>','<br>' );
440 bufline := CustomStringReplace( bufline,'</ul>','<br>' );
442 if DeleteSyria = true then
443 bufline := TreatSyria(bufline);
444 ThreadStrings.Strings[i] := bufline;
448 procedure TAbon.Execute(var ResString : String; ResNumber : Integer);
450 NGwordsLine : Integer;
455 if FindNGwords(ResString, NGwordsLine ,invisi) <> Reverse then begin
456 if invisi = true then begin
459 if not ReturnNGwordLineNum and not SetNGResAnchor then begin
460 ResString := FAbonString;
461 end else if not ReturnNGwordLineNum then begin
462 ResString := Format(' <> <> <>>%d<><>',[(ResNumber)]);
463 end else if not SetNGResAnchor then begin
464 ResString := Format(' <> <> <><B> %d
\8ds
\96Ú
\82ÌNG
\83\8f\81[
\83h
\82ª
\8aÜ
\82Ü
\82ê
\82Ä
\82¢
\82Ü
\82·
\81B</B><><>',[NGwordsLine]);
466 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)]);
470 bufline := ResString;
471 if Deleterlo = true then begin
472 bufline := CustomStringReplace( bufline,'&rlo;','' );
473 bufline := CustomStringReplace( bufline,'&lro;','' );
475 if Replaceul = true then begin
476 bufline := CustomStringReplace( bufline,'<ul>','<br>' );
477 bufline := CustomStringReplace( bufline,'</ul>','<br>' );
479 if DeleteSyria = true then
480 bufline := TreatSyria(bufline);
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 //
\8c»
\8dÝ
\83Z
\83b
\83g
\82³
\82ê
\82Ä
\82¢
\82éNGword.txt
\82ð
\8aJ
\82
514 procedure TAbon.EditNGwords();
516 ShellExecute(0 ,nil,PChar(FNGwordpath),nil,nil,SW_SHOW);
518 //
\83|
\83b
\83v
\83A
\83b
\83v
\97p
\94»
\92è
\8aÖ
\90\94
519 function TAbon.CheckAbonPopupRes(line : String) :Boolean;
524 if AbonPopupRes = true then begin
525 Result := FindNGwords(line, i ,v);
530 //
\95¡
\90\94\82ÌNG
\83\8f\81[
\83h
\83e
\83L
\83X
\83g
\82ð
\93Ç
\82Ý
\8d\9e\82Þ==============================================
531 //List
\83t
\83@
\83C
\83\8b\82ð
\93Ç
\82Ý
\8d\9e\82Þ
532 function TAbon.LoadListFile(path :String; listStringList : TStringList) : Boolean;
535 listStringList.LoadFromFile(path);
538 listStringList.Append('
\88ê
\94Ê=NGword.txt');
539 listStringList.SaveToFile(path);
543 //List
\82Ì
\88ê
\82Â
\8e\9f\82ÌNG
\83\8f\81[
\83h
\83t
\83@
\83C
\83\8b\82ð
\93Ç
\82Ý
\8d\9e\82Þ
544 function TAbon.GoForward() : Boolean;
546 FNGwordFileIndex := FNGwordFileIndex + 1;
547 Result := ReadNGwordslist(FNGwordFileIndex);
549 //List
\82Ì
\88ê
\82Â
\91O
\82ÌNG
\83\8f\81[
\83h
\83t
\83@
\83C
\83\8b\82ð
\93Ç
\82Ý
\8d\9e\82Þ
550 function TAbon.GoBack() : Boolean;
552 FNGwordFileIndex := FNGwordFileIndex -1;
553 Result := ReadNGwordslist(FNGwordFileIndex);
555 //List
\82Ì
\82P
\8ds
\96Ú
\82ð
\93Ç
\82Þ
556 procedure TAbon.GoHome();
558 FNGwordFileIndex := 0;
559 ReadNGwordslist(FNGwordFileIndex);
561 //List
\82Ìline
\8ds
\96Ú
\82ð
\93Ç
\82Þ
562 function TAbon.ReadNGwordslist(line : Integer) : Boolean;
564 liststl : TStringList;
567 liststl := TStringList.Create;
569 if LoadListFile(Flistpath,liststl) = true then begin
570 if line < 0 then begin
571 line := liststl.Count - 1;
572 FNGwordFileIndex := liststl.Count - 1;
573 end else if line > liststl.Count - 1 then begin
575 FNGwordFileIndex := 0;
577 linebuf := liststl.Strings[line];
578 FNGwordname := Copy(linebuf,1,AnsiPos('=',linebuf)-1);
579 Delete(linebuf,1,AnsiPos('=',linebuf));
580 SetNGwordpath(linebuf);
590 //
\95¡
\90\94\82ÌNG
\83\8f\81[
\83h
\83e
\83L
\83X
\83g
\82ð
\93Ç
\82Ý
\8d\9e\82Þ=====
\82±
\82±
\82Ü
\82Å=================================
591 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\8eÀ
\8ds
\8aÖ
\90\94
592 procedure TAbon.IndividualAbon(var ThreadStrings : TStringList; SetResNumFile : String);
596 if FileExists(SetResNumFile) = true then begin
597 if LoadFromSetResNumFile(SetResNumFile) = true then begin
598 for i := 0 to High(FAbonRes) do begin
599 if (FAbonRes[i].Res <= ThreadStrings.Count) and (FAbonRes[i].Res > 0) then begin
600 if FAbonRes[i].option = 0 then begin
601 ThreadStrings.Strings[FAbonRes[i].Res-1] := '';
603 ThreadStrings.Strings[FAbonRes[i].Res-1] := '
\82 \82Ú
\81`
\82ñ<>
\82 \82Ú
\81`
\82ñ<>
\82 \82Ú
\81`
\82ñ<>
\82 \82Ú
\81`
\82ñ<>';
610 FIndividualFileName := SetResNumFile;
611 SetLength(FAbonRes,1);
612 FAbonRes[0].Res := 0;
613 FAbonRes[0].option := -1;
616 procedure TAbon.IndividualAbon(var ResString : String; SetResNumFile : String; ResNumber : Integer);
620 if FileExists(SetResNumFile) = true then begin
621 if LoadFromSetResNumFile(SetResNumFile) = true then begin
622 for i := 0 to High(FAbonRes) do begin
623 if FAbonRes[i].Res = ResNumber then begin
624 if FAbonRes[i].option = 0 then begin
627 ResString := '
\82 \82Ú
\81`
\82ñ<>
\82 \82Ú
\81`
\82ñ<>
\82 \82Ú
\81`
\82ñ<>
\82 \82Ú
\81`
\82ñ<>';
634 FIndividualFileName := SetResNumFile;
635 SetLength(FAbonRes,1);
636 FAbonRes[0].Res := 0;
637 FAbonRes[0].option := -1;
641 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\83t
\83@
\83C
\83\8b\93Ç
\82Ý
\8d\9e\82Ý
\8aÖ
\90\94
642 function TAbon.LoadFromSetResNumFile(SetResNumFile : String) : Boolean;
644 bufStringList : TStringList;
648 bufStringList := TStringList.Create;
651 bufStringList.LoadFromFile(SetResNumFile);
652 FIndividualFileName := SetResNumFile;
654 for i := bufStringList.Count-1 downto 0 do begin
655 if bufStringList.Strings[i] = '' then begin
656 bufStringList.Delete(i);
660 //
\83\81\83\82\83\8a\8am
\95Û
661 SetLength(FAbonRes,bufStringList.Count);
663 for i :=0 to bufStringList.Count - 1 do begin
664 bufLine := Trim(bufStringList.Strings[i]);
665 FAbonRes[i].Res := StrToInt(Copy(bufLine,1,AnsiPos('-',bufLine)-1));
666 FAbonRes[i].option := StrToInt(Copy(bufLine,AnsiPos('-',bufLine)+1,1));
677 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\83t
\83@
\83C
\83\8b\82É
\92Ç
\89Á
678 procedure TAbon.AddIndividualAbon( ResNum : Integer ; option : Integer);
680 IndividualFile : TStringList;
684 IndividualFile := TStringList.Create;
685 if FAbonRes[0].Res <> 0 then begin
686 for i := 0 to High(FAbonRes) do begin
687 if FAbonRes[i].Res <> ResNum then begin
688 linebuf := IntToStr(FAbonRes[i].Res) + '-' + IntToStr(FabonRes[i].option);
689 IndividualFile.Append(linebuf);
693 linebuf := IntToStr(ResNum) + '-' + IntToStr(option);
694 IndividualFile.Append(linebuf);
696 IndividualFile.SaveToFile(FIndividualFileName);
701 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\83t
\83@
\83C
\83\8b\82©
\82ç
\8dí
\8f\9c
702 procedure TAbon.DeleteIndividualAbon( ResNum : Integer);
704 IndividualFile : TStringList;
708 IndividualFile := TStringList.Create;
709 if FAbonRes[0].Res <> 0 then begin
710 for i := 0 to High(FAbonRes) do begin
711 if FAbonRes[i].Res <> ResNum then begin
712 linebuf := IntToStr(FAbonRes[i].Res) + '-' + IntToStr(FabonRes[i].option);
713 IndividualFile.Append(linebuf);
717 if IndividualFile.Count <> 0 then begin
719 IndividualFile.SaveToFile(FIndividualFileName);
724 if FileExists(FIndividualFileName) = true then begin
725 DeleteFile(FIndividualFileName);
729 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\82Ì
\83\8a\83X
\83g
\82Ì
\8cÂ
\90\94\82ð
\95Ô
\82·
730 function TAbon.GetAbonResCount() : Integer;
734 if FAbonRes[0].Res = 0 then begin
741 //
\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·
742 function TAbon.GetAbonResString(Num : Integer) : String;
744 if (Num <= High(FAbonRes)) and (Num >= 0) then begin
745 Result := IntToStr(FAbonRes[Num].Res);
750 //
\83|
\83b
\83v
\83A
\83b
\83v
\82Ì
\94»
\92è
\97p
751 function TAbon.CheckIndividualAbonList(ResNum : Integer) : Boolean;
755 if FAbonRes[0].Res <> 0 then begin
756 for i := 0 to High(FAbonRes) do begin
757 if FAbonRes[i].Res = ResNum then begin
766 //
\83V
\83\8a\83A
\8cê
\83u
\83\89\83N
\83\89\91Î
\8dô
767 function TAbon.TreatSyria(AString: string): string;
769 //count: Integer; //(܀~ݏ)
773 pos := AnsiPos('', AString);
774 while pos <> 0 do begin
775 if AString[pos+6] = ';' then begin
776 if StrToIntDef(Copy(AString, pos+4, 2), 0) <= 71 then begin
777 tmp := tmp + Copy(AString, 1, pos - 1);
778 Delete(AString, 1, pos+6);
780 tmp := tmp + Copy(AString, 1, pos + 6);
781 Delete(AString, 1, pos+6);
784 tmp := tmp + Copy(AString, 1, pos + 3);
785 Delete(AString, 1, pos+3);
787 pos := AnsiPos('', AString);
789 if Length(AString) > 0 then
790 tmp := tmp + AString;
794 pos := AnsiPos('³', AString);
795 while pos <> 0 do begin
796 if AString[pos+6] = ';' then begin
797 if StrToIntDef(Copy(AString, pos+5, 1), 0) > 2 then begin
798 tmp := tmp + Copy(AString, 1, pos - 1);
799 Delete(AString, 1, pos+6);
801 tmp := tmp + Copy(AString, 1, pos + 6);
802 Delete(AString, 1, pos+6);
804 tmp := tmp + Copy(AString, 1, pos - 1);
805 Delete(AString, 1, pos+6);
807 tmp := tmp + Copy(AString, 1, pos + 4);
808 Delete(AString, 1, pos+4);
810 pos := AnsiPos('³', AString);
812 if Length(AString) > 0 then
813 tmp := tmp + AString;