Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
String manipulation question
Message
De
14/05/2011 15:41:36
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Divers
Thread ID:
01510681
Message ID:
01510682
Vues:
60
>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
>
Can you give typical examples of bookmarks.markname and bookmarks.cfield so we can more easily follow your logic?

One potential workaround: if lcReplaceText contains CHR( 13 )s, temporarily STRTRAN() them to some other character (such as a high ASCII value), then STRTRAN() the text control back when the replacement is complete.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform