Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Removing contents from memo field
Message
From
12/04/2009 19:23:00
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01394458
Message ID:
01394462
Views:
74
This message has been marked as the solution to the initial question of the thread.
You have to do some basic string manipulation. The steps are:

1. Search for "Dear customer", using the at() command. This will give you the position where "Dear customer" starts (or zero if not found - you should do some error-checking).

2. Extract everything after that position; substr() seems appropriate here.
local lcSearchText
lcSearchText = "My customer"
replace MyMemoField with substr(MyMemoField, max(at(lcSearchText, MyMemoField), 1))
Not tested exhaustively. The max() ensures that you start, at least, at position 1: Otherwise, if the search text is not found, you would start at position zero; and a quick test reveals that would return an empty string (and therefore eliminate your entire memo field).
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform