이것은 파티션 스크립트와 관련이 있으며 파티션 기능 후 선택 및 선택되지 않은 행을 다른 테이블로 저장하려고합니다. 하지만 그렇게 하면 전체 JSL 스크립트가 무한 루프에 빠지게 됩니다. 해결할 수 있는 방법이 있습니까?
행 상태 처리기(행 선택 반전) 내에서 행을 새로 선택하기 때문에 무한 루프에 들어갈 것입니다. 매개변수를 사용하여 행 선택을 방지할 수 있습니다. ㅏ 당신은 이미 함수에 (상태가 변경된 행을 알려야 함) 이것에 대한 몇 가지 아이디어를 가지고 있습니다.
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/big class.jmp");
tableCount = 0;
theRows = [];
filepath = "$Desktop";
f = Function({a},
// Set dupRows to the previously selected rows
dupRows = theRows;
// Get the current selected rows
theRows = a;
If(N Rows(theRows) > 0,
// check to see if there are the same number of rows
// then validate the rows are different rows before saving
If(N Rows(theRows) == N Rows(dupRows),
If(Sum(dupRows == theRows) != N Rows(theRows),
tableCount++;
dtTemp = dt << subset(invisible, rows(theRows), selected columns(0));
dtSEG = dt << subset(rows(dupRows), selected columns(0));
Close(dtTemp, save(filepath || "\" || "part" || ".jmp"));
Close(dtSEG, save(filepath || "\" || "seg2" || ".jmp"));
)
,
// If not the same number of selected rows, save the subset
tableCount++;
dtTemp = dt << subset(invisible, rows(theRows), selected columns(0));
dtSEG = dt << subset(rows(dupRows), selected columns(0));
Close(dtTemp, save(filepath || "\" || "part" || Char(tableCount) || ".jmp"));
Close(dtSEG, save(filepath || "\" || "seg2" || Char(tableCount) || ".jmp"));
)
);
Show(a, tableCount); //debug print
);
rs = Current Data Table() << make row state handler(f);나는 아마도 행 상태 핸들러를 피하고 선택이 완료되었을 때 사용자가 버튼을 누를 수 있는 일종의 새 창을 사용할 것입니다. 이것은 행 상태 처리기에 상당한 문제가 있었고 가능할 때마다 이를 피하려고 하기 때문입니다.
도움을 주셔서 감사합니다. 이제 제대로 작동합니다. 행 상태 핸들러를 제거하고 창을 닫을 때 호출되는 함수를 사용했습니다. 이렇게 하면 두 개의 하위 집합이 생성됩니다.