Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Replace inside memo field
Message
From
07/04/2019 10:24:12
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Replace inside memo field
Miscellaneous
Thread ID:
01667999
Message ID:
01667999
Views:
98
Hi,

I've string like this
y = [Datum proizvod<PR>nje:  <#nnnn PR#> aaa <#trt  pr#> <<DATUMPROIZVODNJE>>]
I want to replace the "pr" (all PR,pr,Pr...) with eg "7777" only if that "pr" is not inside
<#>  or inside  <<>>
variable "y" should look like:
Datum 7777oizvod<7777>nje:  <#nnnn PR#> aaa <#trt  pr#> <<DATUMPROIZVODNJE>>
I tried this, but it's not good, it's a problem
<#nnnn PR#> and <#trt  pr#>
... it's two words
...
x = y

FOR i = 1 TO ALINES( laArray, x )
 y = laArray[i]
 ? y
 
 IF ATC("PR",y)>0
     n=OCCURS('PR', UPPER(y))   
     yy=y
     FOR ix=1 TO n
             IF (INLIST(GETWORDNUM(yy,ix),"<<","<#"))
                 loop
             ENDIF
            
          yy= STRTRAN(yy,"PR","7777",1,1,3)
     ENDFOR
     ? yy
 ENDIF
...
Next
Reply
Map
View

Click here to load this message in the networking platform