Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Filetostr() problem
Message
From
12/01/2010 08:00:51
 
 
To
12/01/2010 07:50:09
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2000 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01443384
Message ID:
01443385
Views:
71
>Hi all,
>
>i have a text/xml document and with filetostr() i'm importing it into vfp. There is one problem : i'm my text file there are 'strange' characters like '&' and they need to stay like that. When i look into the imported string the '&' has changed into 'amp|,'
>
>Does somebody has a clue how to solve this problem ?
>
>thnx

Actually it's the other way around, your XML contains the strange characters which are converted by the program you use to watch the XML. You can use STRTRAN() to convert these "chain of characters" into real characters. This is a function to create these XML (and HTML) characters, you can simply reverse the expressions to get what you want.
Function txt2html
LPARAMETER lcHTML

lcHTML = STRTRAN(lcHTML,"<","&lt;")
lcHTML = STRTRAN(lcHTML,">","&gt;")
lcHTML = STRTRAN(lcHTML,["],"&quot;")
lcHTML = STRTRAN(lcHTML,[& ],"&amp;")

RETURN lcHTML
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform