Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
StrLen API?
Message
De
10/02/2004 02:09:37
Al Doman (En ligne)
M3 Enterprises Inc.
North Vancouver, Colombie Britannique, Canada
 
 
À
10/02/2004 02:00:48
Larry Long
ProgRes (Programming Resources)
Georgie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00875783
Message ID:
00875784
Vues:
21
>I need to remove trailing chr(0)'s from a null terminated string. I gathered from VFP help that I should be able to do this by...
>
>SET LIBRARY TO STRLEN
>cTest = "Hello"+repl(chr(0),10)
>nLen = STRLEN(cTest) && should return 5
>cString = LEFT(cTest, nLen)
>
>but no such library exists as far as I can tell.
>Can anyone shed any light on this for me?
cTest = "Hello" + REPLICATE(CHR(0), 10)
cString = CHRTRAN(cTest, CHR(0), "")
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform