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
 
 
To
19/11/2009 14:38:58
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:
01435655
Views:
36
There is the actual content - articles names?

>>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
>
>
>Someone has told me that this feature is presented in an article on FoxRockx! this month. Hmm... May have to subscribe just to check it out.
>
>http://www.foxrockx.com/foxrockx/tableofcontents.htm
>
>.
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