Loop Through and Delete Items

Discuss the new Quantrix 4 Scripting Feature!

Moderators: Ben G, Moderators

Loop Through and Delete Items

Postby RLopez » Wed Nov 15, 2017 12:19 am

In scripting, I need to know the syntax to delete items where a cell value is not equal to a specified value. For example:
delteitems.JPG

In the screen shot I want to loop through each “Use” entry and remove from Matrix 1 via a script the items in category B that have a “Use” not equal to “YES”.
You do not have the required permissions to view the files attached to this post.
RLopez
Quantrix Forum Member
 
Posts: 51
Joined: Wed Mar 12, 2014 10:38 am

Re: Loop Through and Delete Items

Postby RLopez » Thu Nov 16, 2017 11:55 am

|Matrix1::B|.items.each
{
if (!|Matrix1|.getSelection(it, |Matrix1::Use|).value.equals(“YES”))
it.delete()
}

Thanks to the IDBS Support desk on this one. As a note the exclamation point “!” in the “if” function is “not equals”. If you wanted to removed all “YES” items instead then simply remove the “!” from the “if” function.
You do not have the required permissions to view the files attached to this post.
RLopez
Quantrix Forum Member
 
Posts: 51
Joined: Wed Mar 12, 2014 10:38 am


Return to Scripting

Who is online

Users browsing this forum: No registered users and 1 guest