BookmarkSubscribe
Choose Language Hide Translation Bar
Shlomizr
Community Trekker

Parse stop at @

Hi,

I am trying to execute below script, when I try to parse string that has @ I get below error (see log below), please advise.

 

 

dt= data table ("RECIPE");
col={"COL_RECIPE@112345@X*HELLO", "COL_RECIPE@78902@X*GET"};
If( Contains( col[1], "COL_RECIPE@112345@X*HELLO" ),
dt<< New Column ("NEW_RECIPE",
Character,
);
text="Column(\!"NEW_RECIPE\!")<< Formula(:" || col[1] || ");";
Eval(Parse(text));
);

 

 

error log:

Unexpected "@". Perhaps there is a missing "," or ")".
Trying to parse arguments of function "Formula".
Line 1 Column 43: ...E")<< Formula(:COL_RECIPE►@112345@X*HELLO);...

0 Kudos
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
pmroz
Super User

Re: Parse stop at @

JMP is getting confused because the column name contains "@" and "*".  This code will work:

dt = Open( "$sample_data\Big Class.jmp" );
col = {"COL_RECIPE@112345@X*HELLO", "COL_RECIPE@78902@X*GET"};
If( Contains( col[1], "COL_RECIPE@112345@X*HELLO" ),
	dt << New Column( "NEW_RECIPE", Character, );
	text = evalinsert("\[Column(dt, "NEW_RECIPE")<< Formula(:name("^col[1]^"));]\");
	Eval( Parse( text ) );
);

View solution in original post

2 REPLIES 2
Highlighted
pmroz
Super User

Re: Parse stop at @

JMP is getting confused because the column name contains "@" and "*".  This code will work:

dt = Open( "$sample_data\Big Class.jmp" );
col = {"COL_RECIPE@112345@X*HELLO", "COL_RECIPE@78902@X*GET"};
If( Contains( col[1], "COL_RECIPE@112345@X*HELLO" ),
	dt << New Column( "NEW_RECIPE", Character, );
	text = evalinsert("\[Column(dt, "NEW_RECIPE")<< Formula(:name("^col[1]^"));]\");
	Eval( Parse( text ) );
);

View solution in original post

Shlomizr
Community Trekker

Re: Parse stop at @

Thanks for your great support, work perfect.
0 Kudos