Hallo. Ich bin ein JSL-Neuling, habe aber einige Skripterfahrung mit VBA und Python.
Ich habe eine Tabelle mit den zwei Spalten „purification_run“ und „parent_purification_runs“. Ich möchte jede Zeile löschen, die ein Feld „purification_run“ enthält, das in einem der Felder „parent_purification_runs“ enthalten ist. Um dies zu erreichen, habe ich das folgende JSL-Skript geschrieben. Es wird ausgeführt, führt jedoch nicht den beabsichtigten Löschvorgang durch. Kann mir jemand helfen, mich auf den richtigen Weg zu bringen? Danke!
// Get handles to the columns
purificationRunCol = Column("purification_run");
parentPurificationRunsCol = Column("parent_purification_runs");
// Get the list of all unique parent_purification_runs values
allParentPurificationRuns = parentPurificationRunsCol << Get Values;
// Iterate through each row
For Each Row(
// Get the purification_run value for the current row
currentPurificationRun = purificationRunCol << Get As String;
// Check if the purification_run is present in the list of parent_purification_runs
If(Contains(allParentPurificationRuns, currentPurificationRun),
// Delete the row if the condition is true
Current Data Table() << Delete Rows;
);
);Dies ist eine Möglichkeit, das Problem anzugehen
Names Default To Here( 1 );
dt = Current Data Table();
// Get the list of all parent_purification_runs values
allParentPurificationRuns = :parent_purification_runs << get values;
For Each Row(
If( Contains( allParentPurificationRuns, :purification_run ),
dt << Select Rows( Row() )
)
);
Try( dt << delete rows );