Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to parse a string for a sign
Message
From
26/05/2003 02:12:15
 
 
To
26/05/2003 01:10:55
Lutz Scheffler (Online)
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00792098
Message ID:
00792778
Views:
24
This message has been marked as a message which has helped to the initial question of the thread.
>Hi Gregory,
>
>this is great! Thank you for your help.
>
>Agnes

Agnes,

You're welcome. It needs a test though

By the way, if you do not want the replacement after the 'from' clause (from table1, table2), then replace the last part with
&& (3) Final
	local NotBeyond, ReplaceByLen
	ReplaceByLen = len(ReplaceBy)
	
	RegExp.Global = FALSE
	RegExp.Pattern = '\sfrom\s'
	RegExp.IgnoreCase = TRUE
	Match = RegExp.Execute(s)
	NotBeyond = iif(empty(Match.Count), len(Source), Match.Item[0].FirstIndex)
	
	RegExp.Global = TRUE
	RegExp.IgnoreCase = FALSE
	RegExp.Pattern = SearchFor
	Match = RegExp.Execute(s)
		
	for i = Match.Count - 1 to 0 step -1
		if( Match.Item[i].FirstIndex < NotBeyond )
			Source = stuff(Source, Match.Item[i].FirstIndex + 1, Match.Item[i].Length, ReplaceBy)
			NotBeyond = NotBeyond  - Match.Item[i].Length + ReplaceBylen
		endif
	endfor
	
	return Source 
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform