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:
01007193
Vues:
20
>>>Hi everybody,
>>>
>>>Do you have a function which would return names of all procedures/functions (and may be with parameters) from a long utility?
>>>
>>>Thanks in advance.
>>
>>Open the PRG and then Click on Document View :o))) (w/o parameters :o(((( ). Unfortunately I don't know how to take this in a list. I 'll go surch in Download section to see if I can find some.
>
>I know about it. I need this list in more convenient format, like cursor, for example. Say,
>
>FunName C(100)
>Parameters M
>FunDescription M
>
>==============
>I actually once wrote something like this, so let me search my old function archives (being lazy I hoped to avoid doing it) < g >

Look what I found:
********************************************************************
*  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
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
		CASE INLIST(lcFirstWord, '#', 'lparam','param','enddef','endp','endfu','proc','func','protect','hidden')
			INSERT into newprg (cLine) value (TRIM(prg.cline))
			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)
*!*	*			lcNewLine=STRTRAN(lcNewLine, lcOldParent, lcOldClass)
				lcComment="* Definition of "+lcOldClass+" of "+lcOldParent
				INSERT into newprg(cLine) value (lcComment)
				INSERT into newprg(cLine) value (lcNewLine)
	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)
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform