Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Extract a Word
Message
De
11/07/2001 14:04:33
 
 
À
11/07/2001 14:01:46
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00529297
Message ID:
00529302
Vues:
13
This message has been marked as a message which has helped to the initial question of the thread.
>Is there a quick way to extract a "Word" from a string? I thought there were functions similar to WordCount() and WordNum(), but I can't find them.
>
>The idea is to do something like this:
>
>
>MyString = "Option 1;Option 2;Option3"
>for i = 1 to WordCount(MyString, ",")
>  ? WordNum(MyString, i, ",")
>next
>
Try this:
FUNCTION ParmCnt
* Return the number of parameters in a list
* expC1 Parameter list
* expC2 Delimiter (default is the comma)
PARAMETER tcParms,tcDelimiter
LOCAL lcDelimiter
IF TYPE('tcDelimiter')<>'C'
   lcDelimiter=','
   ELSE
   lcDelimiter=tcDelimiter
ENDIF
RETURN IIF(EMPTY(tcParms),0,OCCURS(lcDelimiter,tcParms)+1)
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform