Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Case insensitive strtran()
Message
From
30/04/2001 03:06:38
 
 
To
25/04/2001 14:12:07
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00499747
Message ID:
00501422
Views:
35
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform