home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 8 / CDASC08.ISO / NEWS / 554 / JUIN / PROCFIND.PAS < prev    next >
Pascal/Delphi Source File  |  1993-10-07  |  1KB  |  54 lines

  1. {─ Fido Pascal Conference ────────────────────────────────────────────── PASCAL ─
  2. Msg  : 399 of 591
  3. From : John Dailey                         1:374/38.0           23 Jun 93  15:56
  4. To   : Dale Barnes                         1:3601/200.0
  5. Subj : Program Wanted : Try This
  6. ────────────────────────────────────────────────────────────────────────────────
  7. DB> Does anyone know of any program that will scan an entire
  8. DB> programs pascal source code and give a listing of each
  9. DB> procedure/function in each file?
  10.  
  11. Well, that doesn't sound too hard.  Lesse if I can help.  Try this one on for
  12. size, and if it doesn't work, don't blame me <laughs>!}
  13.  
  14. Program Find_Procs_And_Funcs(input, output);
  15.  
  16. Uses Crt, Dos;
  17.  
  18. Var
  19.    filename : String;
  20.  
  21.  Procedure Ucase(Var line_to_do : String);
  22.  Var
  23.     n : Byte;
  24.  Begin
  25.   For n := 1 To Length(line_to_do) Do
  26.       line_to_do[n] := Upcase(line_to_do[n]);
  27.  End;
  28.  
  29.  Procedure Do_File;
  30.  Var
  31.     line,
  32.     tline  : String;
  33.     infile : Text;
  34.  Begin
  35.   Assign(infile, filename);
  36.   Reset(infile);
  37.   While Not Eof(infile) Do
  38.    Begin
  39.     Readln(infile, line);
  40.     tline := line;
  41.     Ucase(tline);
  42.     If (Pos('PROCEDURE', tline) <> 0) Or (Pos('FUNCTION', tline) <> 0) Then
  43.        Writeln(line);
  44.    End;
  45.   Close(infile);
  46.  End;
  47.  
  48. Begin
  49.  Writeln('Find Procs_And_Funcs');
  50.  Writeln;
  51.  Write('Filename : ');
  52.  Readln(filename);
  53.  Do_File;
  54. End.