Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Case insensitive strtran()
Message
De
30/04/2001 03:06:38
 
 
À
25/04/2001 14:12:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00499747
Message ID:
00501422
Vues:
32
>Hi All,
>
>Has anyone written a case insensitive STRTRAN() replacement.
>
>NO, I can't just use VFP 7!
>
>BOb

Assuming Internet Explorer 5.0+ is installed (or WSH 5.0+). Note that the pattern can be much more powerful than a simple string: http://msdn.microsoft.com/scripting/default.htm?/scripting/vbscript/doc/vsmthexecute.htm
strContents = [asdkjdfasksometextsdjafSOMETEXTfdasjasdf]
wait window strtranc( strContents, "sometext", "MoreText" )

function strtranc( tcString, tcPattern, tcReplacement )
	* Create a regular expression object
	local loRegExp
	loRegExp = createobject( "VBScript.RegExp" )

	* Set our pattern
	loRegExp.pattern = tcPattern
	loRegExp.IgnoreCase = .t.
	loRegExp.global = .t.

	return loRegExp.replace( tcString, tcReplacement )
endfunc
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform