Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
101 VFP7 THings, Part 13 - AProcInfo()
Message
From
20/12/2000 00:17:08
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
20/12/2000 00:14:00
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00455019
Message ID:
00455343
Views:
47
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?

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform