OSDN Git Service

個別あぼーんのバグ修正
authorh677 <h677>
Tue, 2 Sep 2003 14:45:28 +0000 (14:45 +0000)
committerh677 <h677>
Tue, 2 Sep 2003 14:45:28 +0000 (14:45 +0000)
AbonUnit.pas

index 0ee3bba..6b79082 100644 (file)
@@ -69,6 +69,7 @@ type
     procedure DeleteIndividualAbon( ResNum : Integer);
     function GetAbonResCount() : Integer;
     function GetAbonResString(Num : Integer) : String;
+    function CheckIndividualAbonList(ResNum : Integer) : Boolean;
     //--
     function ExecuteFile(datfilepath : String; NGwordpath : String) : Boolean; overload;//DAT\83t\83@\83C\83\8b\82ð\92¼\82É\82¢\82\82é
     function ExecuteFile(datfilepath : String; resnum : Integer) : Boolean; overload; //DAT\83t\83@\83C\83\8b\82ð\92¼\82É\82¢\82\82é
@@ -557,6 +558,7 @@ procedure TAbon.EditNGwords();
 begin
     ShellExecute(0 ,nil,PChar(FNGwordpath),nil,nil,SW_SHOW);
 end;
+//\83|\83b\83v\83A\83b\83v\97p\94»\92è\8aÖ\90\94
 function TAbon.CheckAbonPopupRes(line : String) :Boolean;
 begin
     if AbonPopupRes = true then begin
@@ -741,17 +743,40 @@ begin
 end;
 //\8cÂ\95Ê\82 \82Ú\81`\82ñ\82Ì\83\8a\83X\83g\82Ì\8cÂ\90\94\82ð\95Ô\82·
 function TAbon.GetAbonResCount() : Integer;
+var
+       i : Integer;
 begin
-       Result := High(FAbonRes);
+    if FAbonRes[0].Res = 0 then begin
+       Result := 0
+    end else begin
+               i := High(FAbonRes);
+        Result := i+1;
+    end;
 end;
 //\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·
 function TAbon.GetAbonResString(Num : Integer) : String;
 begin
-       if (Num < High(FAbonRes)) and (Num >= 0) then begin
+       if (Num <= High(FAbonRes)) and (Num >= 0) then begin
        Result := IntToStr(FAbonRes[Num].Res);
     end else begin
        Result := '';
     end;
 end;
+//\83|\83b\83v\83A\83b\83v\82Ì\94»\92è\97p
+function TAbon.CheckIndividualAbonList(ResNum : Integer) : Boolean;
+var
+       i : Integer;
+begin
+       if FAbonRes[0].Res <> 0 then begin
+       for i := 0 to High(FAbonRes) do begin
+               if FAbonRes[i].Res = ResNum then begin
+               Result := true;
+                Exit;
+            end;
+        end;
+    end;
+    Result := false;
+    
+end;
 end.