cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
mdawson69
Level IV

Message Unknown Appearing in Valid JSL Code

Recently, I have noticed that JSL is reporting unknown message for valid code. Below is the latest example (unknown messages highlighted):

 

Names Default to Here(1);
Delete Symbols();

databaseFile = Pick File(
	"Select Music Collection File",
	"$DOCUMENTS",
	{"Music Collection|csv"},
	1,
	0
);

albumTable = Open(databaseFile);

albumTable << Delete Rows(N Rows());
:Name("Artist/Album") << Set Name("Title");
:Single 2 << Set Name("CD Single");

:LP << Value Labels({0 = "False", 1 = "True"});
:EP << Value Labels({0 = "False", 1 = "True"});
:Single << Value Labels({0 = "False", 1 = "True"});
:Album << Value Labels({0 = "False", 1 = "True"});
:CD Single << Value Labels({0 = "False", 1 = "True"});
:Want << Value Labels({0 = "False", 1 = "True"});

albumTable << New Column(
	"Artist Block",
	Character,
	Formula(If(:Format == "", :Title))
);

albumTable << New Column(
	"Artist",
	Character,
	Formula(
		If(Row() != 1,
			If(:Artist Block == "",
				Lag(:Artist, 1),
				:Artist Block
			),
			:Artist Block
		)
	)
);

albumTable << Move Selected Columns({"Artist"}, To First);
tableName = albumTable << Get Name();

artistCategoryTable = albumTable << Subset(
	Output Table("Artist Category " || tableName),
	Copy Formula(0),
	All Rows,
	Selected Columns Only(0)
);

Close(albumTable, NoSave);

artistRowFilter = artistCategoryTable << Data Filter(
	Mode(Include(1)),
	Inverse(1),
	Add Filter(
		Columns(:Artist Block),
		Where(:Artist Block == "")
	),
	Invisible
);

artistCategoryTable << Delete Rows;
artistCategoryTable << Delete Columns(:Artist Block);

artistRowFilter << Clear;
artistRowFilter << Delete;

As in other scripts where I have seen this color coding, this script runs without issue. Any ideas on why valid JSL messages are being flagged as unknown?

1 ACCEPTED SOLUTION

Accepted Solutions
DaveB
Staff

Re: Message Unknown Appearing in Valid JSL Code

It looks like you have the "Color unknown object messages" preference turned on. You can find this setting in the "JSL formatting" group box in the Script Editor preference group.  Prior to running the script the albumTable variable has not been assigned so jmp is not aggressive in marking object messages as unknown.  When the script is run, albumTable is set equal to a table and then that table is closed.  At that point jmp can better determine which messages are valid and since a closed table cannot handle a "delete rows" message, the message will then be colored red.  Since evaluating objects and messages can be time consuming, JMP does not recheck every script everytime an variable is changed so you might need to reformat the script or else edit the line with the message to see the color update.

View solution in original post

9 REPLIES 9
gzmorgan0
Super User (Alumni)

Re: Message Unknown Appearing in Valid JSL Code

@mdawson69,

 

Which lines of JSL are being highlighted? There are several lines of JSL that are confusing:

 

  • albumTable << Delete Rows(N Rows());   What is the intent of this JSL? 
  • All the code using the data filter is confusing. Simply use  
    artistCategoryTable << select where(:Artist=="");
    artistCategoryTable << delete rows();

 

Without more details, I do not understand your issues.

Craige_Hales
Super User

Re: Message Unknown Appearing in Valid JSL Code

edit: ignore this reply after additional explanation below...thanks Jeff!

 

Also: unknown is a terse error message JMP uses when something happens that JMP was unprepared for. You can run the JSL a statement at a time, watching the log, to isolate the problem. JMP tries to diagnose errors when the JSL is parsed and executed; if JMP catches an error without planning for the error, all JMP can say is unknown.

 

If you can post a self-contained example, JMP might have a better message for the next person that finds it. Sending the example to tech support will make sure it gets tracked.

 

The problem may be more obvious once the problem line is known and you can study the values in the variables (print them to the log). It could be a missing value or character data where numeric data is needed, or it could be two parameters to a function call swapped, or using a table row too big or too small, or something else. All of these should have a better message than unknown.

 

@EvanMcCorkle @Audrey_Shull 

Craige
mdawson69
Level IV

Re: Message Unknown Appearing in Valid JSL Code


@Craige_Hales wrote:

Also: unknown is a terse error message JMP uses when something happens that JMP was unprepared for. You can run the JSL a statement at a time, watching the log, to isolate the problem. JMP tries to diagnose errors when the JSL is parsed and executed; if JMP catches an error without planning for the error, all JMP can say is unknown.

 

If you can post a self-contained example, JMP might have a better message for the next person that finds it. Sending the example to tech support will make sure it gets tracked.

 

The problem may be more obvious once the problem line is known and you can study the values in the variables (print them to the log). It could be a missing value or character data where numeric data is needed, or it could be two parameters to a function call swapped, or using a table row too big or too small, or something else. All of these should have a better message than unknown.


If I am not missing what you are trying to relay, it seems as if you are referring to a message window or an error reported by the Debugger. The flags I am getting are in the code. Based on the default color coding for JSL the keywords in red are either errors or unknown messages. As I do not get an error message when saving the script and it runs without issue, that only possibility left is that the keywords in red are unknown messages.

Jeff_Perkinson
Community Manager Community Manager

Re: Message Unknown Appearing in Valid JSL Code

Now I understand what you're describing. The picture helps explain that the color coding in the script editor isn't coloring the valid messages correctly. Instead, it's coloring them red as the default preferences proscribe for Messages Unknown.

 

Parallels DesktopScreenSnapz004.png

 

That's really odd. I've never seen that before. What version of JMP are you running?

-Jeff
mdawson69
Level IV

Re: Message Unknown Appearing in Valid JSL Code


@Jeff_Perkinson wrote:

That's really odd. I've never seen that before. What version of JMP are you running?


Ditto. As I stated, I never had this issue until a few months ago. It is really weird. I did try to experiment with creating a dark mode theme for JSL a while ago, but ultimately went back to the default settings, as I am not as well versed in what all the items in the style list are associated with in JSL. It does not help that I know just enough about color science to be quite **bleep** about selecting colors that are complementary, but also well suited to the overall theme; I just do not have that much free time right now. ☹️

 

I am running JMP 14.3. As I am our company’s JMP administrator, I make a point of trying to keep the JMP users up-to-date.

mdawson69
Level IV

Re: Message Unknown Appearing in Valid JSL Code

The highlighting does not come through when code is added to a post with a JSL tag, so here is a screenshot of the code with the flags.

Screen Shot 2019-07-30 at 13.44.43.png

As I stated in my originanl post, the script does work as intended, but the fact that many lines have reserved words flagged as Unknown Message makes me think that there is another underlying issue. I have been using JSL for a few years and it has only been in the past couple of months that I now get these unknown message flags. Now that I think about it, this probably started after updating my JMP installation to 14.3.

 

gzmorgan0 wrote:

albumTable << Delete Rows(N Rows());   What is the intent of this JSL?

 

That line of code deletes the last row in the data table that is not album data.

 

gzmorgan0 wrote:

All the code using the data filter is confusing. Simply use  

artistCategoryTable << select where(:Artist=="");
artistCategoryTable << delete rows();

 

The filtering code I have in the script was generated by JMP when I was manually going through the process. While I have been using JSL for about 5 years, I am by no means an expert due to the fact that my workload is such that I have little time to learn anything new let alone master it, so I rarely generate a script completely from scratch. Top that off with the fact that I now need to learn R because one of our clients uses R and insists the we do the same.

DaveB
Staff

Re: Message Unknown Appearing in Valid JSL Code

It looks like you have the "Color unknown object messages" preference turned on. You can find this setting in the "JSL formatting" group box in the Script Editor preference group.  Prior to running the script the albumTable variable has not been assigned so jmp is not aggressive in marking object messages as unknown.  When the script is run, albumTable is set equal to a table and then that table is closed.  At that point jmp can better determine which messages are valid and since a closed table cannot handle a "delete rows" message, the message will then be colored red.  Since evaluating objects and messages can be time consuming, JMP does not recheck every script everytime an variable is changed so you might need to reformat the script or else edit the line with the message to see the color update.

mdawson69
Level IV

Re: Message Unknown Appearing in Valid JSL Code

That was it. I must have inadvertently enabled “Color unknown object messages” when I was attempting to create a Dark Mode theme.

hogi
Level XII

Re: Message Unknown Appearing in Valid JSL Code

I love having “Color unknown object messages” enabled:

hogi_0-1685545266756.png

 

Then I can quickly check if objects are initialized.
but sometimes, messages are marked red, although, they are "known".
Some minutes later, Jmp corrects the error.

example: dt is known as a data table - and some minutes later, Jmp will know that it can send Begin Data Update to the data table.
Why is Begin Data Table marked as unknown?

hogi_1-1685545368987.png