home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / alt / lang / basic / 987 < prev    next >
Encoding:
Internet Message Format  |  1992-12-23  |  1.7 KB

  1. Path: sparky!uunet!spool.mu.edu!yale.edu!ira.uka.de!sol.ctr.columbia.edu!ucselx!crash!filebank!richard.vannoy
  2. From: richard.vannoy@filebank.cts.com (Richard Vannoy) 
  3. Newsgroups: alt.lang.basic
  4. Subject: Advice on SUB and FUNCTIO
  5. Message-ID: <35.339.uupcb@filebank.cts.com>
  6. Date: 22 Dec 92 21:46:00 GMT
  7. Distribution: world
  8. Organization: The File Bank BBS - Fallbrook, CA  619-728-4318
  9. Reply-To: richard.vannoy@filebank.cts.com (Richard Vannoy) 
  10. Lines: 36
  11.  
  12. GY>    1.   Compile a list of all FUNCTIONS and SUBROUTINES called in
  13. GY>         the programs.
  14. GY>    2.   Compile a list of all FUNCTIONS and SUBROUTINES declared in
  15. GY>         the programs.
  16.  
  17. I did something similar once.  This type of program would
  18. compile all files, one by one, into a master text or random
  19. access file which could then be sorted by function, program,
  20. etc.
  21.  
  22. Since there are so many ways to do this, like reading in all
  23. the .BAS file names automatically and such improvements, I'll
  24. use abbreviated or pseudo code.
  25.  
  26. DO
  27.    OPEN "WHATEVER" FOR RANDOM (OR OUTPUT) AS #2
  28.    INPUT "Enter the file name ";filname$
  29.    IF filename$ = "" THEN CLOSE & END program
  30.    OPEN filname$ FOR INPUT AS #1
  31.    DO
  32.        LINE INPUT #1,l$
  33.        IF LEFT$(l$,8) = "DECLARE "
  34.           OR LEFT$(l$,4) = "SUB "
  35.           OR LEFT$(l$,9) = "FUNCTION " THEN
  36.              PRINT #2, filename$ + " " + l$
  37.              'Write it out to the data file, keeping
  38.              'the original file name with it
  39.    LOOP WHILE NOT EOF(1)
  40. LOOP UNTIL forever
  41.  
  42. Once you get all the DECLARE, SUB and FUNCTION lines in one
  43. place, along with the original files they came from, you can
  44. check, manipulate and cross reference just about any way you
  45. want.
  46. --- MegaMail 2.10 #0
  47.                                   
  48.