Sorry, I meant delete from the Before array. This is untested, but should show the idea.
LONGINT ARRAY FROM SELECTION($tablePtr->;$aBefore) USE SET($highlightSet) LONGINT ARRAY FROM SELECTION($tablePtr->;$aAfter) DELETE SELECTION($tablePtr->) $size:=Size of array($aBefore) For ($i;$size;1;-1) $pos:=Find in array($aBefore{$i};$aAfter) If ($pos=-1) DELETE FROM ARRAY($aBefore;$pos) End if End for CREATE SELECTION FROM ARRAY($tablePtr->;$aBefore Keith - CDI > On Jul 3, 2019, at 3:03 PM, Keith Culotta via 4D_Tech <4d_tech@lists.4d.com> > wrote: > > I recall there being a bit more work in between these two lines, but LONGINT > ARRAY FROM SELECTION will create ordered arrays representing the records. > Then delete the missing records from the after array, and used CREATE > SELECTION FROM ARRAY to get the new selection. > > Keith - CDI > >> On Jul 3, 2019, at 2:05 PM, Sannyasin Siddhanathaswami via 4D_Tech >> <4d_tech@lists.4d.com> wrote: >> >> Aloha, >> >> I’m trying to update my "delete selection of records from a listbox" code. >> I’m trying to keep the sort order so that when someone clicks to delete, >> the only thing they see is the lines they select, get deleted. >> >> Here’s the basic code. Of course, deleting a record in this scenario, leaves >> an empty record in the listbox. >> >> COPY NAMED SELECTION($tablePtr->;"TempCurrentSet") >> USE SET($highlightSet) >> DELETE SELECTION($tablePtr->) >> USE NAMED SELECTION("TempCurrentSet") >> CLEAR NAMED SELECTION("TempCurrentSet") >> >> I haven’t been able to figure out how to keep the sort, and get rid of the >> deleted records (now showing as blank). >> >> Any ideas? >> >> ********************************************************************** 4D Internet Users Group (4D iNUG) Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **********************************************************************