Filtering one list out of another

Terry Judd terry.judd at unimelb.edu.au
Mon Dec 23 18:12:56 EST 2013


I'm sure there are lots of ways to do it but this should work...

put empty into tList
repeat for each line tValue in A
	if not(cr&B&cr contains cr&tValue&cr) then
		put tValue &cr after tList
	end if
end repeat
delete last char of tList

Terry...


On 24/12/2013, at 09:57 AM, Devin Asay wrote:

> Hello LiveCode savants,
> 
> I'm pretty sure this can be done, but I've puzzled over this for a while and my brain asplode.
> 
> I have two lists of integers:
> 
> A B
> -- --
> 1 2
> 2 5
> 3 7
> 4 8
> 5
> 6
> 7
> 8
> 9
> 10
> 
> I want to get only the lines in list A that are not in list B:
> 
> Result desired:
> --------------------
> 1
> 3
> 4
> 6
> 9
> 10
> 
> Will filter work for this? I already tried, without much hope of success, 'filter A without B'. As expected, no go.
> 
> Any ideas?
> 
> Devin
> 
> 
> Devin Asay
> Learn to code with LiveCode University
> http://university.livecode.com
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
> 

Dr Terry Judd
Senior Lecturer in Medical Education
Medical Education Unit
Faculty of Medicine, Dentistry & Health Sciences
The University of Melbourne









More information about the Use-livecode mailing list