cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Instantly extract effect sizes, F-ratios, and FDR-adjusted p-values from your models with the Calculate Effects Sizes extension, available now in the JMP Marketplace!
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
hogi
Level XIII

from a name to a string

To remove a symbol, I can write:

y=6;
mySymbol = Expr(y);
//Delete Symbols("y"); 
////Delete Symbols(y); // <- easy
Eval(Eval Expr(Delete Symbols(Expr(Name Expr(mySymbol)))));
Show symbols()

If I need to remove a symbol from a namespace, I need the string of the symbol:

Names Default To Here( 1 );
nsref = New Namespace(
	"ns"
);
ns:x = 20;

mySymbol = Expr( x );

//nsref << Remove("x")

Eval(
	Substitute(
			Expr(
				nsref << Remove( _sym_ )
			),
		Expr( _sym_ ), Substitute( Expr( Char( __sym__ ) ), Expr( __sym__ ), Name Expr( mySymbol ) )
	)
);


s = NameExpr( mySymbol );  
str = Char(s) );  // Name not defined        
Show( str );

 

What is the right syntax for 

Char(s)

?

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: from a name to a string

Head Name(expr) ?

Names Default To Here(1);

ms = Expr(x);
Head Name(ms); // "x"

 

-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User

Re: from a name to a string

Head Name(expr) ?

Names Default To Here(1);

ms = Expr(x);
Head Name(ms); // "x"

 

-Jarmo
hogi
Level XIII

Re: from a name to a string

many thanks, @jthi 

Recommended Articles