Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
101 VFP7 THings, Part 13 - AProcInfo()
Message
 
 
To
20/12/2000 00:17:08
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00455019
Message ID:
00455404
Views:
34
>Correction, because of the formatting... using textmerge delimiters doesn't show too nice in the HTML, therefore two new lines:
>
>>
>>* 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=GETWORDNUM(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 GETWORDNUM(lcLine,2)='class'
>>			lcOldClass=GETWORDNUM(lcLine, 3)
>>			lcOldParent=GETWORDNUM(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="* redefinition of "+lcOldClass+" of "+tcPrgFile
>>			INSERT into newprg(cLine) value (lcComment)
>>			INSERT into newprg(cLine) value (lcNewLine)
>>	ENDCASE
>>ENDSCAN
>>
>>SELECT newprg
>>SET TEXTMERGE on noshow to memvar cNewText
><b>SET TEXTMERGE DELIMITERS TO "{{","}}"</b>
>>SCAN
>>	<b>\{{TRIM(cLine)}}</b>
>>	\
>>ENDSCAN
>>SET TEXTMERGE to
>>SET TEXTMERGE off show
>>=STRTOFILE(cNewText, tcNewFile)
>>
>
>>
>>I know, the result would need some extra formatting... what else would you want in 20 minutes?

Dragan,

I tried to run it in VFP6.0, I had to replace GetWordNum with WordNum, I passed wgUtility.prg, 'wgUtility_Def.prg',' '. Finally it gave me an Error message, variable cNewText is not found. What's wrong?
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform