Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Removing patterns from string on cursor field
Message
From
27/02/2019 21:39:24
 
 
To
27/02/2019 20:22:31
Luis Santos
Biglevel-Soluções Informáticas, Lda
Portugal
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Network:
Windows Server 2012 R2
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01666814
Message ID:
01666823
Views:
70
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform