Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parsing pieces into smaller pieces
Message
De
12/07/2007 11:15:12
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Parsing pieces into smaller pieces
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01239718
Message ID:
01239718
Vues:
47
The code below creates object properties based on text between the "|" delimiters. There are times when that text will also contain another "^" delimiter (or others). One sledgehammer solution I'm considering is to just replace all the "^" with "|" so that they are broken-up into separate properties (fields ultimately), but wondered if there was a way to trap them while processing in case I eventually need to treat them differently. The resulting properties/fields are manually defined and mapped with a data dictionary, so I don't have to know when there is a "^" delimiter - just that there is a delimiter. Since the "^" delimiters really just define related pieces of information - for example "|Jay^Johengen|" contains FName and LName, I think going with the sledgehammer might work because I'm mapping both fields eventually anyway. Any thoughts?
FOR ix=1 TO OCCURS('|',m.tcLine)
	ADDPROPERTY(loRecord, 'Field'+PADL(m.ix,3,'0'), STREXTRACT(m.tcLine,'|','|',m.ix,2))
ENDFOR
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform