cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Use World Cup data to build models, explore spatial relationships, and create informative visualizations in JMP. Register. July 17, 2 pm US Eastern Time.
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
SDF1
Super User

JSL: How to correctly display ampersand (&) in Textbox() with Markup?

Hello fellow JSL scripters,

 

  I'm trying to use an ampersand in a Text Box() call while also using the <<Markup command, and I'm coming across some issues. Apparently, the <<Markup send command formats text with specified HTML tags.

 

  As an example, here's some JSL that I thought should work, but doesn't.

 

w = New Window( "Formatted Text",
	Text Box( "This is <b>bold</b> text. This is <b><i>bold italic</i></b> text, & this is <u>underlined</u> text.",
	<<Markup) );

  Instead, I get this as the output and an error in the log:

SDF1_1-1750860547690.png

Warning: unterminated entity "&" encountered. -- Turning off markup flag -- This is <b>bold</b> text. This is <b><i>bold italic</i></b> text & is <u>underlined</u> text.
DisplayBox[EvalContextBox]

 

  I would have thought this would be easy to find a solution to, but JMP Help, Scripting Index, Scripting Guide, and searches don't really talk about this specific issue. I did try the HTML tag &amp, and it doesn't work.

 

Thanks for any help!,

DS

 

1 ACCEPTED SOLUTION

Accepted Solutions
SDF1
Super User

Re: JSL: How to correctly display ampersand (&) in Textbox() with Markup?

I just found it by looking at the source code for my posting and saw that I wasn't using the &amp tag correct, it should be: &amp; with the semicolon at the end. It works now.

 

Hope this helps others,

DS

View solution in original post

1 REPLY 1
SDF1
Super User

Re: JSL: How to correctly display ampersand (&) in Textbox() with Markup?

I just found it by looking at the source code for my posting and saw that I wasn't using the &amp tag correct, it should be: &amp; with the semicolon at the end. It works now.

 

Hope this helps others,

DS

Recommended Articles