Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Give me a list of all functions/procedures in a long pro
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01007186
Message ID:
01007231
Vues:
22
This message has been marked as the solution to the initial question of the thread.
What about:
********************************************************************
*  Description.......: Functions2NewPrg
*  Calling Samples...: 
*  Parameter List....: tcPrgfile, tcNewFile, tcPrefix
*  Created by........: Dragan Nedeljkovich  #012046 
*  Modified by.......: Nadya Nosonovsky 12/20/2000 09:39:15 AM
********************************************************************
* parameter checking left to users (if any)
LPARAMETERS tcPrgfile, tcNewFile, tcPrefix
LOCAL flag_comma
CLOSE DATABASES all
CREATE CURSOR newprg (cLine c(127))
CREATE CURSOR prg (cLine c(127))

APPEND FROM (tcPrgFile) sdf
SCAN
   lcLine=LOWER(ALLTRIM(cLine))
   lcFirstWord=WORDNUM(lcLine, 1)
   DO CASE
********* UPDATE
      CASE lcFirstWord == '#' .OR. INLIST(LEFT(lcFirstWord,4), 'lpar','para','endd','endp','endf','proc','func','prot','hidd')
************************************
           INSERT into newprg (cLine) value (TRIM(prg.cline))
           flag_comma  = (RIGHT(ALLTRIM(prg.cline),1) == ",")

      CASE lcFirstWord ='define' and WORDNUM(lcLine,2)='class'
	   lcOldClass  = WORDNUM(lcLine, 3)
	   lcOldParent = WORDNUM(SUBSTR(lcLine, AT('as ',lcline)+3),1)
           lcNewClass  = STUFF(lcOldClass,1, LEN(tcPrefix), tcPrefix)
           lcNewLine   = STRTRAN(lcLine, lcOldClass,lcNewClass)
           lcComment   = "* Definition of "+lcOldClass+" of "+lcOldParent
           INSERT into newprg(cLine) value (lcComment)
           INSERT into newprg(cLine) value (lcNewLine)
      CASE flag_comma
           INSERT into newprg (cLine) value (TRIM(prg.cline))
           flag_comma  = (RIGHT(ALLTRIM(prg.cline),1) == ",")
   ENDCASE
ENDSCAN
local cNewText
SELECT newprg
local lcHeader
lcHeader="* Functions Definitions in "+tcPrgFile
=strtofile(lcHeader,tcNewFile)
set textmerge on
SET TEXTMERGE to (tcNewFile) noshow additive && memvar cNewText
SET TEXTMERGE DELIMITERS TO "{{","}}"
SCAN
	\{{TRIM(cLine)}}
	\
ENDSCAN
SET TEXTMERGE to
SET TEXTMERGE off show
*=STRTOFILE(cNewText, tcNewFile)
(not tested)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform