Choose Language Hide Translation Bar
Highlighted
Shlomizr
Level II

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);...

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

Highlighted
Shlomizr
Level II

Re: Parse stop at @

Thanks for your great support, work perfect.
Article Labels

    There are no labels assigned to this post.