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 11:22:30
 
 
To
14/11/2006 11:10:12
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01169359
Message ID:
01169513
Views:
7
>I think your attempt works fine in the case where there is at least one non-blank character after the embedded UPC Code. If however, the string is "Small Widget 1 12345 12345 1", it returns spurious results.

>I believe this is caused by your looping; lnPos should only try to move to the next non-blank character if there are characters left to be searched for. (i.e., in all cases except the last character)

This was just a quick attempt -- my thought is to find the UPC pattern within the main string, ignoring spaces.

I will leave it to you as an exercise to complete the code for all cases. :)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform