<?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 Re: How to check whether a preference is set and how in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-check-whether-a-preference-is-set-and-how/m-p/618688#M81802</link>
    <description>&lt;P&gt;The returned value is a command to set the preferences as they &lt;STRONG&gt;are&lt;/STRONG&gt; at the moment.&lt;/P&gt;&lt;P&gt;You could convert the command to a string, parse it and check if the option is enabled or disabled:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;returnedString=Char(Get Platform Preference( Control chart builder( K sigma ) ));
Regex(returnedString,"(on|off)","\1")&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 31 Mar 2023 14:28:06 GMT</pubDate>
    <dc:creator>hogi</dc:creator>
    <dc:date>2023-03-31T14:28:06Z</dc:date>
    <item>
      <title>How to check whether a preference is set and how</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-check-whether-a-preference-is-set-and-how/m-p/618636#M81797</link>
      <description>&lt;P&gt;I would like to check, whether a preference is set to a certain value, but with JSL I cannot retrieve the value to compare it in an if statement etc. and react upon situation. Get Preferences returns something, but what excactly is it and how to proceed with it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

// Task: what is the preference set to
prefs = Get Platform Preference( Control chart builder( K sigma ) );

// hover over prefs shows the result correctly, but how to retrieve it,
// e.g. as a string?

// what type is this? JMP gives no answer
Type( prefs );

// it has a length
length(prefs);

// this does not work
Log Capture( Get Platform Preference( Control chart builder( K sigma ) ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Jun 2023 16:06:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-check-whether-a-preference-is-set-and-how/m-p/618636#M81797</guid>
      <dc:creator>Georg</dc:creator>
      <dc:date>2023-06-09T16:06:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to check whether a preference is set and how</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-check-whether-a-preference-is-set-and-how/m-p/618688#M81802</link>
      <description>&lt;P&gt;The returned value is a command to set the preferences as they &lt;STRONG&gt;are&lt;/STRONG&gt; at the moment.&lt;/P&gt;&lt;P&gt;You could convert the command to a string, parse it and check if the option is enabled or disabled:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;returnedString=Char(Get Platform Preference( Control chart builder( K sigma ) ));
Regex(returnedString,"(on|off)","\1")&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 31 Mar 2023 14:28:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-check-whether-a-preference-is-set-and-how/m-p/618688#M81802</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-03-31T14:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to check whether a preference is set and how</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-check-whether-a-preference-is-set-and-how/m-p/619782#M81919</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/26800"&gt;@hogi&lt;/a&gt;&amp;nbsp;, that worked perfectly. I was irritated, because I assigned the preference command to a variable, and then cast to character didn't work. But it's the magic of JSL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;returnedCommand = Get Platform Preference( Control chart builder( K sigma ) );
// this gives nothing:
show(char(returnedCommand));

returnedString=Char(Get Platform Preference( Control chart builder( K sigma ) ));
// this works
show (returnedString);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Apr 2023 11:02:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-check-whether-a-preference-is-set-and-how/m-p/619782#M81919</guid>
      <dc:creator>Georg</dc:creator>
      <dc:date>2023-04-04T11:02:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to check whether a preference is set and how</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-check-whether-a-preference-is-set-and-how/m-p/619923#M81923</link>
      <description>&lt;P&gt;Couldn't you also check the literal as an expression?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names default to here(1);
Get Platform Preference( Control chart builder( K sigma ) ) == Expr(Platform Preferences( Control chart builder( K Sigma( 3, &amp;lt;&amp;lt;Off ) ) ));
// for me this returned 1&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Apr 2023 21:30:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-check-whether-a-preference-is-set-and-how/m-p/619923#M81923</guid>
      <dc:creator>vince_faller</dc:creator>
      <dc:date>2023-04-04T21:30:22Z</dc:date>
    </item>
  </channel>
</rss>

