Print Page | Close Window

Text convert for Markup

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=15242
Printed Date: 13 September 2025 at 5:32am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Text convert for Markup
Posted By: jimmy
Subject: Text convert for Markup
Date Posted: 25 September 2009 at 2:18am
Hello,

Is there a function to convert a user text to a showable text under Markup Tooltip.
Convert '>' to '>', ...
We use XTP 12.0.2

  Jimmy




Replies:
Posted By: ijwelch
Date Posted: 25 September 2009 at 10:25pm
Not built in. This is VB code I've been using:

Public Function FormatXAMLText(ByVal s As String) As String
s = Replace$(s, "&", "&")
s = Replace$(s, "<", "&lt;")
s = Replace$(s, ">", "&rt;")
s = Replace$(s, Chr(34), "&quot;")
s = Replace$(s, "'", "&apos;")
s = Replace$(s, " ", "&#160;")

FormatXAMLText = s
End Function


-------------
ExtremeSuitePro 12.1.1
WinXP SP3


Posted By: jimmy
Date Posted: 28 September 2009 at 6:14am
Hi,

also must convert
\n -> \#10   new line
' ' -> \#32   space

  Jimmy



Posted By: znakeeye
Date Posted: 28 September 2009 at 9:05am
I've been looking for such a function for years. In PHP you simply call htmlspecialchars(). In MFC it seems you have to implement it yourself. Tedious...

-------------
PokerMemento - http://www.pokermemento.com/


Posted By: jimmy
Date Posted: 29 September 2009 at 3:36am
Wish:
  Add this to Codejock Library.

  Jimmy



Posted By: znakeeye
Date Posted: 29 September 2009 at 11:34am
Maybe such a function exists in ATL?

-------------
PokerMemento - http://www.pokermemento.com/



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net