Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Odd string replacement: STRTRAN but with embedded spaces
Message
From
14/11/2006 08:35:27
 
 
To
14/11/2006 08:30:03
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01169359
Message ID:
01169435
Views:
8
Of course, yes that's a typo. (tyop?) It should have been removed there as well.

I have not yet had a chance to look at your solution; I've got something to learn about regular expression before I can understand. Can I assume that the CREATEOBJECT line will always work, or must I include something when I install my application to make it work?

Jim


>James,
>
>in addition to my former message:
>
>loRegExp = CREATEOBJECT('VBScript.RegExp')
>
>
>lcUPC=ALLTRIM(cUPC)
>
>lcTemp = ''
>FOR lnloop = LEN(lcUPC)+1 TO 1 STEP -1
> lcUPC = STUFF(lcUPC,lnloop,0,'\s*')
>ENDFOR &&lnLoop
>
>loRegExp.PATTERN    = lcUPC
>
>lcPart = loRegExp.REPLACE(cPart,'')
>
>
>
>The only thing not included is:
>>Occurs a few times:
>>"Big Widget (1 12345 12345 1)" ==> "Big Widget (1 12345 12345 1)"

>but this is a typo isn't it?
>
>Agnes
>>I want the UPC Code to disappear, regardless of the position of the white space.
>>
>>Now, I know there's gonna be some fun with punctuation as well in some of the less frequent case, but I'm sure I can handle that when I get to it. For now:
>>
>>Main ways:
>>"Big Widget 1 12345 12345 1" ==> "Big Widget"
>>"Big Widget - 1 12345 12345 1" ==> "Big Widget - "
>>
>>Occurs a few times:
>>"Big Widget (1 12345 12345 1)" ==> "Big Widget (1 12345 12345 1)"
>>
>>Once only:
>>"Big Widget 1 12345 12345 1 / China" ==> "Big Widget / China"
>>"Big Widget Green:1 12345 12345 1" ==> "Big Widget Green:"
>>
>>As noted before, the spaces within the UPC code in the field can occur anywhere; the pattern used here is just the most frequent usage.
>>
>>
>>>I see your "input" data, but what do you want as output?
Jim Nelson
Newbury Park, CA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform