Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to parse a string for a sign
Message
De
26/05/2003 10:40:00
 
 
À
26/05/2003 04:27:52
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00792098
Message ID:
00792822
Vues:
32
>Gregory,
>Im not sure on that. If I do FROM Table1,Table2 (what I never do, I allways write JOIN statements) I would Prefer it like
>
>FROM Table1,
>Table2
>
>::)
>
>Agnes
>
---------------------------------------
>UPDATE:
>This is very usefull for GROUP BY and ORDER BY CLAUSE.
>

in that case, replace
RegExp.Pattern = '\sfrom\s'
with
RegExp.Pattern = '((\sgroup\sby\s)|(\sorder\s\by\s))'
Gregory
____________________________________

>>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform