Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Bug in GetWordNum
Message
De
13/08/2017 15:38:48
 
 
À
13/08/2017 12:49:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Divers
Thread ID:
01653264
Message ID:
01653268
Vues:
79
The behavior you describe is the designed behavior -- not what I wanted either. In the case of a delimited string such as
lcString = "test1|test2||test4"
I would want the third word to be empty; however, GETWORDNUM() returns test4 as the third word and GETWORDNUM() returns 3, instead of 4. If you do a string translation first and insert a space in a null place:
lcString = "test1|test2||test4"
DO WHILE ATC("||", lcString) > 0
   lcString = STRTRAN(lcString, "||", , "| |")
ENDDO
lcThird = GETWORDNUM(lcString, 3, "|")
Now you will get the results that you expect.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform