cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
FN
FN
Level VI

Including comments in an evaluated NewScript()

What would be the easiest way to include comments in an script that is written when executed?

 

dt = CurrentDataTable();

mystring = "Hello world!";
mylist = {"A", "B", "C"};

Eval(EvalExpr(dt << NewScript( "test",

// This comment will not appear in the new script as it is inside the Eval(EvalExpr())

mystring = Expr(mystring);
mylist = Expr(mylist);

 )));

// JSL output
// mystring = "Hello world!";
// mylist = {"A", "B", "C"};
3 REPLIES 3
txnelson
Super User

Re: Including comments in an evaluated NewScript()

Here is how I would do it

dt = CurrentDataTable();

mystring = "Hello world!";
mylist = {"A", "B", "C"};

Eval(EvalExpr(dt << NewScript( "test",

c = "// This comment will not appear in the new script as it is inside the"; Eval(EvalExpr())

mystring = Expr(mystring);
mylist = Expr(mylist);

 )));

c = "// JSL output";
c="// mystring = \!"Hello world!\!";";
c = "// mylist = {\!"A\!", \!"B\!", \!"C\!"};";
Jim
FN
FN
Level VI

Re: Including comments in an evaluated NewScript()

I was thinking to add print("") as they will document the steps in the log, at least.
txnelson
Super User

Re: Including comments in an evaluated NewScript()

The print will work too......but that is a pretty intensive statement and if it is inside a loop, etc. it can take a lot of processing time.
Jim