Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can I script over my method code to work on it?
Message
De
19/11/2009 14:38:58
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Divers
Thread ID:
01435595
Message ID:
01435653
Vues:
52
>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

.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform