Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Documenting Application

Status
Not open for further replies.

virtualranger

Technical User
Sep 14, 2001
115
0
0
GB
I have inherited a 2.6 (for dos) foxpro app. In the main dbf directory there are loads of tables that I am positive are no longer used or relevant to the current version of the app. However, there are some which I am not so sure about.

Is there a tool I can use to find which tables are actually required for the app? Something a bit like the project builder perhaps where I can put in main.prg and it will find not only all the relevant programs, reports and screen sets but also any of the required tables?

Thanks Cheers,
Jamie
 
Jamie,
Not really, but if you have enough space to copy your app to another machine, (I don't recommend trying this on the same machine that it normally runs on, as that can lead to detrimental behaviour...)
Copy the entire application to another directory. Then, make a directory called "KEEP", in your new location. Copy *.DBF, *.FPT, *.CDX, *.IDX into the keep directory. Then, delete *.dbf, *.fpt, *.cdx, *.idx. Start the app. It WILL complain. (Or at least as soon as you try to do something, it's very likely). Slowly add the corresponding DBF & associated files back into the directory, until you discover which ones you need, and which ones you don't. You wil need to litterally perform every function the application requires during this trial, and if it's a big app, it can become teidous, but if you areally want to clean it up, that is one way to do it without the need to know any code.
Aside from that, there are 2 other things you can do if you have all the code/screens, etc. Open each form. Open all snipets, and do a search for the USE command. USE will always preceed the opening of a table. This may not be fool-proof though. While you're in the form (if it uses forms), you'll need to look at the VIEW window. Before you open the screen, in the command window type:

CLOSE DATA

Then, open your screen. Then, click on Window, and then View. If there are tables in the Work Area, that will indicate that there is an associated "Data Environment" with the screen. Now, that will only be relevent if from the project, the "OPEN/CLOSE" check box is set on. To find that out, open the project, click on the screen set item in the project menu. Then, click the edit button. On the window that appear, click the MORE>> button. There are a bunch of check boxes, the top left two of which will be "OPEN DATABASES" and "CLOSE DATABASES". If they are check on, then your form is using the data tables defined in the view window.
But, to understand which tables are opend by what screen, you must enter that CLOSE DATA command before opening a screen, or they will remain open in the view window, and you will get confused. (If you're not already...)

Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
If you have the source code, you can use Foxpro's Foxdoc to document your application.

You set it up to begin on the starting PRG file and, assuming that you set the numerous "switches" (check boxes) correctly, it will document all files used. It will indicate missing files if it cannot find them.

Good Luck,
JRB-Bldr
VisionQuest Consulting
Business Analyst & CIO Consulting Services
CIOServices@yahoo.com
 
You could try copying the whole app to another machine. Test run the app for a couple of days on the other machine. Hit every screen and button add records and everything else that the system does. After a couple of days check the dates of the files. The dates of the files that the system deninately uses will be changed to the date that you last did the testing. This should get all of the tables for the system. To make sure of it, move the rest of the data tables to another directory and try it again. Slowly add ony others that may have been missed.

Good Luck!

John [spidey] [americanflag] [unclesam]
 
Be aware though, that tables may get accesses and not updated. So the timestamp won't change.
Dave S.
 
Thanks for the responses.

The app is so large that it would take me forever to go thru it all for any of the manual sugestions outlined above (there are over 125 tables and about 112 screen sets).

Foxdoc sounds like the best way forward. I'll give it a whirl. Cheers,
Jamie
 
FoxDoc worked a treat. Listed all the files required by the app and a whole lot of other info that will come in handy too. Thanks people.

Cheers,
Jamie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top