<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Adding color text in a If() JSL in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Adding-color-text-in-a-If-JSL/m-p/620011#M81926</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am writing a JSL Script and not sure how to add color text in this If() code. I want to add green color indicate for "Ideal" and red color for "Not Ideal".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If(P &amp;lt;= 0.5 &amp;amp; C &amp;gt; 0.8, "Ideal",&lt;BR /&gt;P &amp;gt; 0.5 &amp;amp; C &amp;lt; 0.8, "Not Ideal",&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jun 2023 16:07:18 GMT</pubDate>
    <dc:creator>mng1</dc:creator>
    <dc:date>2023-06-09T16:07:18Z</dc:date>
    <item>
      <title>Adding color text in a If() JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Adding-color-text-in-a-If-JSL/m-p/620011#M81926</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am writing a JSL Script and not sure how to add color text in this If() code. I want to add green color indicate for "Ideal" and red color for "Not Ideal".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If(P &amp;lt;= 0.5 &amp;amp; C &amp;gt; 0.8, "Ideal",&lt;BR /&gt;P &amp;gt; 0.5 &amp;amp; C &amp;lt; 0.8, "Not Ideal",&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 16:07:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Adding-color-text-in-a-If-JSL/m-p/620011#M81926</guid>
      <dc:creator>mng1</dc:creator>
      <dc:date>2023-06-09T16:07:18Z</dc:date>
    </item>
    <item>
      <title>Re: Adding color text in a If() JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Adding-color-text-in-a-If-JSL/m-p/620051#M81928</link>
      <description>&lt;P&gt;Where is the "Ideal" or ""Not Ideal" going to be displayed?&amp;nbsp; In a data table, a report, a dialog box?&lt;/P&gt;</description>
      <pubDate>Wed, 05 Apr 2023 06:56:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Adding-color-text-in-a-If-JSL/m-p/620051#M81928</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-04-05T06:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: Adding color text in a If() JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Adding-color-text-in-a-If-JSL/m-p/620175#M81937</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi Jim,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks for replying back! &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Here is a simplified version of my code. The&amp;nbsp;"Ideal" or ""Not Ideal" is going to be displayed in a dialog box.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;P = 0.4

M = If(
    P &amp;lt;= 0.5 &amp;amp; C &amp;gt; 0.8, "Ideal",
    P &amp;gt; 0.5 &amp;amp; C &amp;lt; 0.8, "Not Ideal",

);

M_Output &amp;lt;&amp;lt; set text( Char( M ) );
),
Outline Box( "Results",
Panel Box( "Message",
Lineup Box( N Col( 2 ),
Text Box( "Output: " ),
M_Output = Text Box(),
)

),&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maria&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2023 14:14:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Adding-color-text-in-a-If-JSL/m-p/620175#M81937</guid>
      <dc:creator>mng1</dc:creator>
      <dc:date>2023-04-06T14:14:05Z</dc:date>
    </item>
    <item>
      <title>Re: Adding color text in a If() JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Adding-color-text-in-a-If-JSL/m-p/620184#M81938</link>
      <description>&lt;P&gt;You will need to use Markup notation to change the text color.&lt;/P&gt;
&lt;P&gt;See the Scripting Index&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Text Box=&amp;gt;Markup&lt;/P&gt;
&lt;P&gt;Here is an example from the Scripting Index entry&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
win = New Window( "Example", fontobj = text = Text Box( "Example Text" ) );
text &amp;lt;&amp;lt; setText(
	"This is &amp;lt;font color='Blue'&amp;gt;blue&amp;lt;/font&amp;gt; text. This is a &amp;lt;background color='yellow'&amp;gt;yellow&amp;lt;/background&amp;gt; background. This is &amp;lt;font color='#0000ff'&amp;gt;&amp;lt;background color='0xffff00'&amp;gt;blue text on a yellow background&amp;lt;/background&amp;gt;&amp;lt;/font&amp;gt;."
);
text &amp;lt;&amp;lt; markup;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 05 Apr 2023 13:49:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Adding-color-text-in-a-If-JSL/m-p/620184#M81938</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-04-05T13:49:46Z</dc:date>
    </item>
    <item>
      <title>Re: Adding color text in a If() JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Adding-color-text-in-a-If-JSL/m-p/620248#M81945</link>
      <description>&lt;P&gt;If you want the entire string to be one color you can use &amp;lt;&amp;lt; text color("color").&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;nw = new window("Test Colors",
	r = text box("Red Color", &amp;lt;&amp;lt; text color("red")),
	b = text box("Blue Color", &amp;lt;&amp;lt; text color("blue"))
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pmroz_0-1680707825510.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/51756i88DA519E2C34BD97/image-size/medium?v=v2&amp;amp;px=400" role="button" title="pmroz_0-1680707825510.png" alt="pmroz_0-1680707825510.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The scripting index is your friend here.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Apr 2023 15:17:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Adding-color-text-in-a-If-JSL/m-p/620248#M81945</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2023-04-05T15:17:28Z</dc:date>
    </item>
  </channel>
</rss>

