Page 1 of 1

Showing the TradeMark symbol

Posted: Fri Oct 21, 2016 6:10 am
by caseywhite
There is data stored in the database that currently uses ™ because a web event function is showing the data. In VL web instead of showing ™ (Alt-0153) it shows ™. Is there a way for me to replace ™ with the TM symbol using some intrinsic function?

Re: Showing the TradeMark symbol

Posted: Fri Oct 21, 2016 7:36 am
by LANSAGuru
So the deal is you are attempting (I assume) to put html markup into a label. Raw html markup itself needs to be included as raw html markup. For instance ™ is NOT the trademark symbol. Instead it is the html markup for the trade symbol

So you need to use the html container control. It is like a label, except you can put any html markup you want inside of it.

e.g.

Begin_Com Role(*EXTENDS #PRIM_WEB)
Define_Com Class(#PRIM_LABL) Name(#Label1) Caption('Label1') Displayposition(1) Ellipses(Word) Height(25) Left(119) Parent(#COM_OWNER) Tabposition(1) Tabstop(False) Top(67) Verticalalignment(Center) Width(120)
Define_Com Class(#PRIM_WEB.HtmlContainer) Name(#Html1) Description('Html Container') Displayposition(2) Height(28) Left(120) Parent(#COM_OWNER) Tabposition(2) Tabstop(False) Top(125) Width(150)

Evtroutine Handling(#Com_owner.Initialize)
#Label1 := '™'
#Html1 := '™'
Endroutine

End_Com

Re: Showing the TradeMark symbol

Posted: Fri Oct 21, 2016 7:43 am
by caseywhite
Not quite. I just want to show the TM symbol. I don't want to use HTML. I am assuming like in VB I can use some Chr$ function or something like that to show a TM. So if I detect ™ in the database field I am going to show the TM symbol. The user is telling me they can't get the TM symbol to type or paste into a file.

Re: Showing the TradeMark symbol

Posted: Fri Oct 21, 2016 7:46 am
by MarkD
As in http://www.fileformat.info/info/unicode ... /index.htm ?

Try #MyLabel := (8482).AsUnicodeString

Re: Showing the TradeMark symbol

Posted: Fri Oct 21, 2016 7:59 am
by caseywhite
That is exactly what I was looking for. Thanks a lot. Works perfectly.

Re: Showing the TradeMark symbol

Posted: Fri Oct 21, 2016 8:13 am
by LANSAGuru
Some caveats.

This only works if the target field is Unicode (server module side) which you say is where you are getting the value from.
It only works if you are scanning all values for predefined html entities and hard coding the results.
If you have many of these (different types of html entities) because they are coming form a content management system, this would not work as you would need to write a substitution for every one of them.

If this is a one off this works fine. The point was, if you are just jamming it into a label AND it is ALREADY in html form, you can simply use the html container which is at the end of the day, just a label as well. This will work for any html content embedded inside of a file.

If you simply want to put a trademark simple on a page in a label in VL Web you could simply assign the value to a label.

e.g. (the trade mark symbol font size is increased here for emphasis so you can see it is the actual TM symbol)

#MyLabel := '™'
instead of
#MyLabel := (8482).AsUnicodeString