Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OCCURS() and CHR(34)
Message
From
10/02/2003 10:56:52
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00750824
Message ID:
00751421
Views:
23
Where was my brain on Friday? Not working obviously! Thanks Esparta!
Tracy

>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.
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform