Re: How to check whether a preference is set and howThe returned value is a command to set the preferences as they are at the moment.
You could convert the command to a string, parse it and check if the option is enabled or disabled:
returnedString=Char(Get Platform Preference( Control chart builder( K sigma ) ));
Regex(returnedString,"(on|off)","\1")
Re: How to check whether a preference is set and howThanks @hogi , 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.
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);
Re: How to check whether a preference is set and howCouldn't you also check the literal as an expression?
Names default to here(1);
Get Platform Preference( Control chart builder( K sigma ) ) == Expr(Platform Preferences( Control chart builder( K Sigma( 3, <<OFF></OFF>
How to check whether a preference is set and howI 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?
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 ) ) );
Advanced Statistical ModelingAutomation and ScriptingConsumer and Market ResearchMass Customization