Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parsing Fields
Message
De
06/01/1999 11:51:22
Donald Krasnick
Stanton Systems and Consulting
Havertown, Pennsylvanie, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00173008
Message ID:
00173171
Vues:
21
If you're doing a lot of text processing, take a look at the SYS(15) function. This can be used to quickly do a mass conversion of characters.

The SYS(15) function "translates" the 2nd argument using the 1st argument as a "mask". That is, for each character in the 2nd arg, we use its numeric value as the index into the 1st arg.

For example, the following expression will convert all lower-case characters to upper-cae and all numbers or punctuation into spaces.

lcTran = SPACE(64) + ;
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" + SPACE(6) + ;
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" + SPACE(6)

?SYS(15, lcTran, "abc123DEF$%^") && prints "ABC DEF "

Don
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform