Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OCCURS() and CHR(34)
Message
 
 
À
07/02/2003 16:37:42
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00750824
Message ID:
00750832
Vues:
17
This message has been marked as the solution to the initial question of the thread.
Try something like this:
lcString = ["Hello World"]
?lcString
?OCCURS(["],lcString)
******* Correction *********
?OCCURS(CHR(34),lcString) && It works too
***** End Correction *********
>How do I check for the number of times a double quote occurs in a string using occurs()? I hate to step through the entire string char by char checking for asc(lcstring,i)=34. Assuming that a character string has another character string enclosed within double quotes, how do I count the number of times the double quotes exist in the string? Is there an easier way?

>Here's the slow, long way checking for the letter k:
xiniline="dkdksska1538."
result=";"
FOR i = 1 TO LEN(xiniline)
    result=result+ALLTRIM(STR(ASC(SUBSTR(xiniline,i,1))))+";"
ENDFOR
? (OCCURS('107',result))    && returns 3
>I need to count the number of times a "" appears in the string.
Apoya a Visual FoxPro usandolo legalmente
--
¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º
Espartaco Palma Martínez
SysOp PortalFox
http://www.portalfox.com
esparta@portalfox.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform