cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP Pro extension simulates Bayesian Optimization runs. Prediction formulas stand in for experimental results. Run simulations and compare results. Download and use the extension.

Discussions

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

Deleting table variables

I'm trying to delete table properties in a loop but nothing happens. There's no error message in the log window, so I'm not sure why i can't delete table variables in a loop.

If I use a literal string I'm able to delete the variable, but I would like to delete a list of variables by pattern matching.


dt = New Table("test");



dt << New Table Variable("a", 1);


dt << New Table Variable("b", 1);


dt << New Table Variable("c", 1);



names = dt << Get Table Variable Names;



for(i = N Items(names), i > 0, i--,


    variable = names;


    // Fails


    dt << Delete Table Variable(variable);


);



// Ok


dt << Delete Table Variable("a")


1 ACCEPTED SOLUTION

Accepted Solutions
ms
Super User (Alumni) ms
Super User (Alumni)

Re: Deleting table variables

Your example works here, JMP 10.0.2 for Mac. But it may not be working in JMP 9. Are you using a version <10?

Try this in JMP 9:

dt = New Table( "test" );

dt << New Table Variable( "a", 1 );

dt << New Table Variable( "b", 1 );

dt << New Table Variable( "c", 1 );

names = dt << Get Table Variable Names;

For( i = N Items( names ), i > 0, i--,

  variable = names[i];

  Eval( Parse( Eval Insert( "dt << Delete Table Variable(^nameexpr(variable)^)" ) ) )

);

View solution in original post

2 REPLIES 2
ms
Super User (Alumni) ms
Super User (Alumni)

Re: Deleting table variables

Your example works here, JMP 10.0.2 for Mac. But it may not be working in JMP 9. Are you using a version <10?

Try this in JMP 9:

dt = New Table( "test" );

dt << New Table Variable( "a", 1 );

dt << New Table Variable( "b", 1 );

dt << New Table Variable( "c", 1 );

names = dt << Get Table Variable Names;

For( i = N Items( names ), i > 0, i--,

  variable = names[i];

  Eval( Parse( Eval Insert( "dt << Delete Table Variable(^nameexpr(variable)^)" ) ) )

);

Re: Deleting table variables

I'm using JMP 9. Your solutions works. Thanks

Recommended Articles