OSDN Git Service

関数の清書と、NGの判断の変更(タブで区切られたNGワードでは、それぞれが別に含まれて無いとNGとしないようにした。)
authorh677 <h677>
Tue, 19 Aug 2003 10:48:31 +0000 (10:48 +0000)
committerh677 <h677>
Tue, 19 Aug 2003 10:48:31 +0000 (10:48 +0000)
AbonUnit.pas

index c5e2d3f..7c5661c 100644 (file)
@@ -25,7 +25,7 @@ type
     function Getlistpath() : String;
     procedure Setlistpath(const Value : String);
     function LoadListFile(path :String;listStringList : TStringList) : Boolean;
-    
+    function ReadNGwordslist(line : Integer) : Boolean;
   public
     { Public \90é\8c¾ }
     constructor Create; // \83R\83\93\83X\83g\83\89\83N\83^
@@ -88,9 +88,6 @@ destructor TAbon.Destroy;
 begin
     inherited;
 end;
-
-
-
 //root\82ÍExe\config\NGwords\83t\83H\83\8b\83_
 procedure TAbon.Setroot(root :String);
 var
@@ -259,6 +256,8 @@ begin
                 if AnsiPos(Ftokens[i][j],line) = 0 then begin
                     hit := false;
                     break;
+                end else begin
+                    Delete(line,AnsiPos(Ftokens[i][j],line),Length(Ftokens[i][j]));
                 end;
             end;
             if hit = true then begin
@@ -546,6 +545,7 @@ begin
         Result := false;
     end;
 end;
+//\95¡\90\94\82ÌNG\83\8f\81[\83h\83e\83L\83X\83g\82ð\93Ç\82Ý\8d\9e\82Þ==============================================
 //List\83t\83@\83C\83\8b\82ð\93Ç\82Ý\8d\9e\82Þ
 function TAbon.LoadListFile(path :String; listStringList : TStringList) : Boolean;
 begin
@@ -560,6 +560,24 @@ begin
 end;
 //List\82Ì\88ê\82Â\8e\9f\82ÌNG\83\8f\81[\83h\83t\83@\83C\83\8b\82ð\93Ç\82Ý\8d\9e\82Þ
 function TAbon.GoForward() : Boolean;
+begin
+    FNGwordFileIndex := FNGwordFileIndex + 1;
+    Result := ReadNGwordslist(FNGwordFileIndex);
+end;
+//List\82Ì\88ê\82Â\91O\82ÌNG\83\8f\81[\83h\83t\83@\83C\83\8b\82ð\93Ç\82Ý\8d\9e\82Þ
+function TAbon.GoBack() : Boolean;
+begin
+    FNGwordFileIndex := FNGwordFileIndex -1;
+    Result := ReadNGwordslist(FNGwordFileIndex);
+end;
+//List\82Ì\82P\8ds\96Ú\82ð\93Ç\82Þ
+procedure TAbon.GoHome();
+begin
+    FNGwordFileIndex := 0;
+    ReadNGwordslist(FNGwordFileIndex);
+end;
+//List\82Ìline\8ds\96Ú\82ð\93Ç\82Þ
+function TAbon.ReadNGwordslist(line : Integer) : Boolean;
 var
     liststl : TStringList;
     linebuf : String;
@@ -567,14 +585,16 @@ begin
     liststl := TStringList.Create;
     try
         if LoadListFile(Flistpath,liststl) = true then begin
-            FNGwordFileIndex := FNGwordFileIndex + 1;
-            if FNGwordFileIndex > liststl.Count -1 then begin
+            if line < 0 then begin
+                line := liststl.Count - 1;
+                FNGwordFileIndex := liststl.Count - 1;
+            end else if line > liststl.Count - 1 then begin
+                line := 0;
                 FNGwordFileIndex := 0;
             end;
-            linebuf := liststl.Strings[FNGwordFileIndex];
+            linebuf := liststl.Strings[line];
             FNGwordname := Copy(linebuf,1,AnsiPos('=',linebuf)-1);
             Delete(linebuf,1,AnsiPos('=',linebuf));
-
             SetNGwordpath(linebuf);
             Result := true;
         end else begin
@@ -585,18 +605,6 @@ begin
     end;
 
 end;
-//List\82Ì\88ê\82Â\91O\82ÌNG\83\8f\81[\83h\83t\83@\83C\83\8b\82ð\93Ç\82Ý\8d\9e\82Þ
-function TAbon.GoBack() : Boolean;
-begin
-    FNGwordFileIndex := FNGwordFileIndex -2;
-    if FNGwordFileIndex < -1 then FNGwordFileIndex := 0;
-    Result := GoForward()
-end;
-//List\82Ì\82P\8ds\96Ú\82ð\93Ç\82Þ
-procedure TAbon.GoHome();
-begin
-    FNGwordFileIndex := -1;
-    GoForward();
-end;
+//\95¡\90\94\82ÌNG\83\8f\81[\83h\83e\83L\83X\83g\82ð\93Ç\82Ý\8d\9e\82Þ=====\82±\82±\82Ü\82Å=================================
 end.