Develop and Download Open Source Software

Browse CVS Repository

Diff of /gikonavigoeson/gikonavi/AbonUnit.pas

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.9 by h677, Mon Aug 18 12:50:03 2003 UTC revision 1.10 by h677, Tue Aug 19 10:48:31 2003 UTC
# Line 25  type Line 25  type
25      function Getlistpath() : String;      function Getlistpath() : String;
26      procedure Setlistpath(const Value : String);      procedure Setlistpath(const Value : String);
27      function LoadListFile(path :String;listStringList : TStringList) : Boolean;      function LoadListFile(path :String;listStringList : TStringList) : Boolean;
28            function ReadNGwordslist(line : Integer) : Boolean;
29    public    public
30      { Public 宣言 }      { Public 宣言 }
31      constructor Create; // コンストラクタ      constructor Create; // コンストラクタ
# Line 88  destructor TAbon.Destroy; Line 88  destructor TAbon.Destroy;
88  begin  begin
89      inherited;      inherited;
90  end;  end;
   
   
   
91  //rootはExe\config\NGwordsフォルダ  //rootはExe\config\NGwordsフォルダ
92  procedure TAbon.Setroot(root :String);  procedure TAbon.Setroot(root :String);
93  var  var
# Line 259  begin Line 256  begin
256                  if AnsiPos(Ftokens[i][j],line) = 0 then begin                  if AnsiPos(Ftokens[i][j],line) = 0 then begin
257                      hit := false;                      hit := false;
258                      break;                      break;
259                    end else begin
260                        Delete(line,AnsiPos(Ftokens[i][j],line),Length(Ftokens[i][j]));
261                  end;                  end;
262              end;              end;
263              if hit = true then begin              if hit = true then begin
# Line 546  begin Line 545  begin
545          Result := false;          Result := false;
546      end;      end;
547  end;  end;
548    //複数のNGワードテキストを読み込む==============================================
549  //Listファイルを読み込む  //Listファイルを読み込む
550  function TAbon.LoadListFile(path :String; listStringList : TStringList) : Boolean;  function TAbon.LoadListFile(path :String; listStringList : TStringList) : Boolean;
551  begin  begin
# Line 560  begin Line 560  begin
560  end;  end;
561  //Listの一つ次のNGワードファイルを読み込む  //Listの一つ次のNGワードファイルを読み込む
562  function TAbon.GoForward() : Boolean;  function TAbon.GoForward() : Boolean;
563    begin
564        FNGwordFileIndex := FNGwordFileIndex + 1;
565        Result := ReadNGwordslist(FNGwordFileIndex);
566    end;
567    //Listの一つ前のNGワードファイルを読み込む
568    function TAbon.GoBack() : Boolean;
569    begin
570        FNGwordFileIndex := FNGwordFileIndex -1;
571        Result := ReadNGwordslist(FNGwordFileIndex);
572    end;
573    //Listの1行目を読む
574    procedure TAbon.GoHome();
575    begin
576        FNGwordFileIndex := 0;
577        ReadNGwordslist(FNGwordFileIndex);
578    end;
579    //Listのline行目を読む
580    function TAbon.ReadNGwordslist(line : Integer) : Boolean;
581  var  var
582      liststl : TStringList;      liststl : TStringList;
583      linebuf : String;      linebuf : String;
# Line 567  begin Line 585  begin
585      liststl := TStringList.Create;      liststl := TStringList.Create;
586      try      try
587          if LoadListFile(Flistpath,liststl) = true then begin          if LoadListFile(Flistpath,liststl) = true then begin
588              FNGwordFileIndex := FNGwordFileIndex + 1;              if line < 0 then begin
589              if FNGwordFileIndex > liststl.Count -1 then begin                  line := liststl.Count - 1;
590                    FNGwordFileIndex := liststl.Count - 1;
591                end else if line > liststl.Count - 1 then begin
592                    line := 0;
593                  FNGwordFileIndex := 0;                  FNGwordFileIndex := 0;
594              end;              end;
595              linebuf := liststl.Strings[FNGwordFileIndex];              linebuf := liststl.Strings[line];
596              FNGwordname := Copy(linebuf,1,AnsiPos('=',linebuf)-1);              FNGwordname := Copy(linebuf,1,AnsiPos('=',linebuf)-1);
597              Delete(linebuf,1,AnsiPos('=',linebuf));              Delete(linebuf,1,AnsiPos('=',linebuf));
   
598              SetNGwordpath(linebuf);              SetNGwordpath(linebuf);
599              Result := true;              Result := true;
600          end else begin          end else begin
# Line 585  begin Line 605  begin
605      end;      end;
606    
607  end;  end;
608  //Listの一つ前のNGワードファイルを読み込む  //複数のNGワードテキストを読み込む=====ここまで=================================
 function TAbon.GoBack() : Boolean;  
 begin  
     FNGwordFileIndex := FNGwordFileIndex -2;  
     if FNGwordFileIndex < -1 then FNGwordFileIndex := 0;  
     Result := GoForward()  
 end;  
 //Listの1行目を読む  
 procedure TAbon.GoHome();  
 begin  
     FNGwordFileIndex := -1;  
     GoForward();  
 end;  
609  end.  end.
610    

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26