Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parsing string into a SQL statement
Message
De
22/12/2008 12:36:22
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01369199
Message ID:
01369205
Vues:
6
You and Cetin are so good at this type of string manipulations. I wish I could think in those terms more often.

>Somthing like this? (Quick solution, not even declared variables)
>
>
>? Parse("Race.RaceCode, RaceDesc")
>
>function Parse(vNewVal)
>nPoint	= At('.', vNewVal)
>cSelect	= []
>if nPoint > 1
>	cAlias	= Left(vNewVal, nPoint - 1)
>	cSelect	= [SELECT ]
>	for nLine = 1 to Alines(laLines, Substr(vNewVal, nPoint + 1), 1 + 4, ',')
>		cSelect	= cSelect + Iif(nLine = 1, [], [, ]) + laLines[nLine] + [ AS F] + Transform(nLine)
>	next nLine
>	cSelect	= cSelect + [ FROM ] + cAlias
>endif
>return cSelect
>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform