Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can I script over my method code to work on it?
Message
From
19/11/2009 14:00:09
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01435595
Message ID:
01435647
Views:
47
>Hi Matt,
>
>I think You can automate the whole thing, unfortunately I do not have much time to fully test the RE so take my script as a very early starting point, just an idea, but you could do something like this:
>
>
>* instead of text...endtext use adir to get the prgs, a loop and filetostr() for PRGs, and adding a USE / REPLACE for hacking the SCX/VCX
>
>CLEAR
>
>TEXT TO lcFileContents FLAGS 1 PRETEXT 1 + 2 + 4 noshow
>	m.job_num=alltrim(job_num)
>	 lcJobNo=alltrim(job_num)
>	 x=y+1*4/2
>	 x=(x+y)/3
>	 lcString='Please help+lcMe+'fix this.'
>ENDTEXT
>
>
>
>
>loRegEX			= Createobject('VBScript.RegExp')			&& Create a regular expression.
>
>WITH loRegEX
>	.Pattern		= '(.*?)(\s*?[=\+\*/]{1}?\s*?)+(.*?)'	&& Set pattern.
>	.IgnoreCase		= .T.										&& Set case insensitivity.
>	.Global			= .T.										&& Set global applicability.
>	lcNewContents		= .Replace(lcFileContents, '$1 $2 $3')
>ENDWITH
>
>? lcNewContents && this should be a strtofile(), of course you should back up everything :)
>
>
>
>Note that in the pattern I have [=\+\*/], that is for = + * / symbols (I even forgot about -), you can add the ones you want there


Looks very promising. Thanks for tkaing the time to post this.

.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform