Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
String manipulation question
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
String manipulation question
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Miscellaneous
Thread ID:
01510681
Message ID:
01510681
Views:
113
I'm using a list of keywords/bookmarks to update content in HTML and DOC files. Most of the keywords represent a single piece of data like a name or a value. However there are a few that are multiline values such as addresses which contain CHR(13) values.

Spinning thru the list of bookmarks, the text substitution is performed using something like ....
lcFindText = ALLTRIM(bookmarks.markname)
lcReplaceText = EVALUATE(bookmarks.cField)
ln = thisform.TXTextControl1.Find("&lcFindText",0,16)
IF ln > 0
     thisform.TXTextControl1.setfocus()
     thisform.TXTextControl1.SelText="&lcReplaceText"
ENDIF
All is fine unless a value with a carriage return is contained in the replacement text. Have tried using [lcReplaceText] but it too errors (with "Command contains unrecognized phrase/keyword").

Using the following avoids the error but those multi-line values are shown on a single line. Was trying to maintain those multiline bookmark values.
thisform.TXTextControl1.SelText=(lcReplaceText)
or...
thisform.TXTextControl1.SelText=lcReplaceText
Next
Reply
Map
View

Click here to load this message in the networking platform