キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Discussions

Solve problems, and share tips and tricks with other JMP users.
言語を選択 翻訳バーを非表示

JSL - Escape Character Syntax Error?

Hi all, 

(JMP Pro 17 user) I am running into a strange issue where escape characters don't work in JSL, specifically within Application Builder. 

 

This works:

 

// Example:
Python Submit("print(dt1)");

This does not work:

 

 

// Example:
Python Submit("\[print (dt1)]\");

// this is what I want to use it with, statement is impossible without escape characters: 
Python Submit("\[
dt1 = dt1[~dt1["Column 1"].str.contains("#")]
]\");

When it works, it prints the data table associated with dt1, but when escape characters are placed, this is the log output (just repeats what's within the escape characters):

/**********/

	
	print (dt1)
	
	
/**********/

I'm not sure what is going wrong here, perhaps a syntax error on my end? 

 

1 件の受理された解決策

受理された解決策
jthi
Super User

Re: JSL - Escape Character Syntax Error?

The issue could be caused by incorrect indentation of the python code.

 

This is from JMP18, but I would guess it is same in JMP17

jthi_0-1721150953229.png

jthi_1-1721150964186.png

 

-Jarmo

元の投稿で解決策を見る

3件の返信3

Re: JSL - Escape Character Syntax Error?

Not sure how to edit, but apologies for the messed up formatting.

Re: JSL - Escape Character Syntax Error?

I think I may have resolved this. For some reason it had to be in one line. Putting in line breaks to make the block of code more pretty seemed to break it. 

For example, this works: 

Python Submit("\[dt1 = dt1[~dt1["Column 1"].str.contains("#")]]\");

But this didn't:

Python Submit("\[
	
	dt1 = dt1[~dt1["Column 1"].str.contains("#")]
		
]\");

Not sure why this could be, but I'm glad it's at least working.

jthi
Super User

Re: JSL - Escape Character Syntax Error?

The issue could be caused by incorrect indentation of the python code.

 

This is from JMP18, but I would guess it is same in JMP17

jthi_0-1721150953229.png

jthi_1-1721150964186.png

 

-Jarmo

おすすめの記事