cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Image to Table JMP extension imports single or batch images as data tables. Useful to extract curves from pictures or convert image data to curve data to use in analyses like Functional Data Explorer. Download and install the extension.

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