Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Removing patterns from string on cursor field
Message
De
27/02/2019 21:39:24
 
 
À
27/02/2019 20:22:31
Luis Santos
Biglevel-Soluções Informáticas, Lda
Portugal
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Network:
Windows Server 2012 R2
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01666814
Message ID:
01666823
Vues:
71
Have you looked at CHRTRAN() function?
? CHRTRAN("Hello, world", "oHle", "DACB")
yields the output
ABCCD, wDrCd
'o' replaced with 'D'
'H' replaced with 'A'
'l' replace with 'C'
'e' replaced with 'B'
? CHRTRAN("Hello, world", " ,oHle", "YX")
yields the output
XYwrd
' ' replaced with 'Y'
',' replaced with 'X'
'o', 'H', 'l', and 'e' are replaced by empty string

>Hello comunity,
>
>I have build a program that import into VFP cursor fields from excel file.
>my cursor have 2 field : REF C(18) and Price N(10,2)
>
>But on my column REF i have value like :
>A 123
>100 235
>100-001
>100|300
>
>I need a VFP function to remove blank space or - or | or other patterns that i can choose to update my cursor field REF.
>I dont know if i can do it using STUFF function selecting a range of pattern , for example [ ' '-&| ], of course after select my cursor and doing a SCAN on it to replace each line.
>
>Someone coudl give me a simple example to do this?
>
>Many thanks,
>Best regards,
>Luis
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform