cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Due to the recently reported Microsoft outage, users may be temporarily unable to access My JMP or experience a delay receiving their verification codes. If you have previously installed JMP on your computer, this outage should not impact your ability to access the software. My JMP services will be restored as soon as Microsoft resolves this issue.
  • 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

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