Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Replace inside memo field
Message
De
07/04/2019 10:24:12
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Replace inside memo field
Divers
Thread ID:
01667999
Message ID:
01667999
Vues:
99
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
...
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform