Article View: alt.lang.basic
Article #326Advice on SUB and FUNCTIO
From: Richard Vannoy
Date: Tue, 22 Dec 1992 21:46
Date: Tue, 22 Dec 1992 21:46
36 lines
1782 bytes
1782 bytes
GY> 1. Compile a list of all FUNCTIONS and SUBROUTINES called in
GY> the programs.
GY> 2. Compile a list of all FUNCTIONS and SUBROUTINES declared in
GY> the programs.
I did something similar once. This type of program would
compile all files, one by one, into a master text or random
access file which could then be sorted by function, program,
etc.
Since there are so many ways to do this, like reading in all
the .BAS file names automatically and such improvements, I'll
use abbreviated or pseudo code.
DO
OPEN "WHATEVER" FOR RANDOM (OR OUTPUT) AS #2
INPUT "Enter the file name ";filname$
IF filename$ = "" THEN CLOSE & END program
OPEN filname$ FOR INPUT AS #1
DO
LINE INPUT #1,l$
IF LEFT$(l$,8) = "DECLARE "
OR LEFT$(l$,4) = "SUB "
OR LEFT$(l$,9) = "FUNCTION " THEN
PRINT #2, filename$ + " " + l$
'Write it out to the data file, keeping
'the original file name with it
LOOP WHILE NOT EOF(1)
LOOP UNTIL forever
Once you get all the DECLARE, SUB and FUNCTION lines in one
place, along with the original files they came from, you can
check, manipulate and cross reference just about any way you
want.
--- MegaMail 2.10 #0
Technical Details
Message-ID:
<35.339.uupcb@filebank.cts.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!yale.edu!ira.uka.de!sol.ctr.columbia.edu!ucselx!crash!filebank!richard.vannoyShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!yale.edu!ira.uka.de!sol.ctr.columbia.edu!ucselx!crash!filebank!richard.vannoy From: richard.vannoy@filebank.cts.com (Richard Vannoy) Newsgroups: alt.lang.basic Subject: Advice on SUB and FUNCTIO Message-ID: <35.339.uupcb@filebank.cts.com> Date: 22 Dec 92 21:46:00 GMT Distribution: world Organization: The File Bank BBS - Fallbrook, CA 619-728-4318 Reply-To: richard.vannoy@filebank.cts.com (Richard Vannoy) Lines: 36