Skip to content

Commit

Permalink
Directory Input Bug Fixed
Browse files Browse the repository at this point in the history
Add "Contains Text File" check to Directory Input Procedure.
  • Loading branch information
GALA-X-Y authored Sep 16, 2023
1 parent b2f93e8 commit ccd0c80
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions wordstats.pas
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ procedure DPathChange;
until FindNext(SR) <> 0;
FindClose(SR);
listlength := i - 1;
if listlength = 0 then
DPathChange;
end
else
DPathChange;
Expand All @@ -50,7 +52,7 @@ procedure Print_Heading;
WriteLn(' YbdPYbdP Yb dP 88"Yb 8I dY o.`Y8b 88 dP__Yb 88 o.`Y8b ');
WriteLn(' YP YP YbodP 88 Yb 8888Y" 8bodP'' 88 dP""""Yb 88 8bodP'' ');
WriteLn;
WriteLn('Authored by Hugo Law - Version 1.2.2');
WriteLn('Authored by Hugo Law - Version 1.2.3');
WriteLn;
returnmode := 3;
Batch := False;
Expand Down Expand Up @@ -150,7 +152,11 @@ procedure Print_PList;
begin
DPathChange;
end
else if (i = 2) or (i = 3) then
else if ((i = 3) and (listlength <= 1)) then
begin
WriteLn('There is only one file. Batch Processing remains Off.');
end
else if (i = 2) or ((i = 3) and (listlength > 1)) then
begin
if i = 3 then
begin
Expand Down Expand Up @@ -192,7 +198,7 @@ procedure Print_PList;

function CheckWordFinished(S: String; I : Integer): Boolean;
begin
CheckWordFinished := (S[I] = ' ') or (S[I] = ',') or (S[I] = '.') or (S[I] = '?') or (S[I] = '!')
CheckWordFinished := (S[I] = ' ') or (S[I] = ',') or (S[I] = '.') or (S[I] = '?') or (S[I] = '!') or (S[I] = ':')
end;

procedure Word_Count(rfname : String);
Expand Down

0 comments on commit ccd0c80

Please sign in to comment.