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!

Collection of PRGs - all code in one window

Utility Program

Collection of PRGs - all code in one window

by  ramani  Posted    (Edited  )
*********************************************************
** Author : Ramani (Subramanian.G)
** FoxAcc Software / Winners Software
** ramani_g@yahoo.com
** Type : Freeware with reservation to Copyrights
** Warranty : Nothing implied or explicit
** Last modified : 27 December, 2002
*********************************************************
* This will consolidate all Prgs included in open project
* and open up editor window.
* Save to your convenience with a suitable file name.
*********************************************************
** PROCEDURE gscode3
** How to Run..
** 1. Save the following code as gsCode3.PRG
** 2. Open the project
** 3. From command window type DO gsCode3
*********************************************************
[COLOR BLUE]
** Programe gsCode3

#DEFINE CRLF chr(13)+chr(10)

LOCAL cPrgFile,cText,cOutPut,cTitle,Date_time,cLine,nFiles

** Collect files from project
nFiles = application.ActiveProject.Files.Count
cOutPut = SYS(3)+".txt"

cLine = REPLICATE("*",70)+CRLF

cTitle = "** Documentation of the PRGS in Project: " + ;
application.ActiveProject.Name+CRLF
date_time = "** Date/Time: "+ TTOC(DATETIME())+CRLF

*Write the headers with formTitle+date+time
STRTOFILE("",cOutput,.F.) && Wipe existing file
STRTOFILE(cTitle,cOutPut,.T.)
STRTOFILE(date_time,cOutPut,.T.)
STRTOFILE(cLine,cOutPut,.T.)
STRTOFILE(CRLF+CRLF+CRLF,cOutPut,.T.)
**

FOR i = 1 TO nFiles
cPrgFile = application.ActiveProject.Files(i).NAME
IF UPPER(JUSTEXT(cPrgFile)) = "PRG"
** Now we can actually start
cText=FILETOSTR(cPrgFile)
** Create a sub-title for the form
cTitle = "** PRG: " +cPrgFile+CRLF
STRTOFILE(cTitle,cOutPut,.T.)
STRTOFILE(cLine,cOutPut,.T.)
STRTOFILE(cText,cOutPut,.T.)
STRTOFILE(cLine,cOutPut,.T.)
STRTOFILE("** End of PRG.: "+cPrgFile+CRLF, ;
cOutPut,.T.)
STRTOFILE(cLine+cline+cline+cline+cline,cOutPut,.T.)
STRTOFILE(CRLF+CRLF+CRLF,cOutPut,.T.)
ENDIF
ENDFOR
MODIFY FILE (cOutPut)
STRTOFILE("",cOutput,.F.) && Wipe file created
RETURN [/color]
*********************************************************
* EOF:
*********************************************************
Evaluate this to make others know how useful is this
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top