Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
String problem
Message
 
À
05/12/2008 09:48:58
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01365651
Message ID:
01365665
Vues:
9
If this is a static list you use a lot why not load each value into a character field in a table. Now you have your patterns stored and you can add or delete from them as needed.


CREATE TABLE patterns ( pattern c(5) ) && or whatever size you need
INDEX ON pattern TAG pattern
* load all your strings into table

then write code:
IF NumberOfMatches( cString ) > 0
   * do something
ENDIF



FUNCTION NumberOfMatches( cString )

LOCAL  ARRAY aNumber(1)

SELECT COUNT(*) FROM patterns p WHERE cString $ p.pattern INTO ARRAY aNumber
* or maybe do a direct comare like LOWER( ALLTRIM( cString ) ) == LOWER( ALLTRIM( p.pattern ) )
RETURN aNumber[1]
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform