Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unique items in a list
#1
one thing that would be really useful is something that would pull out the duplicate items in a list but i dont know where to start for this.
ie

apple
orange
apple
grape

returns

apple
orange
grape

any ideas how i can do this?
#2
Create member function str.RemoveDuplicateLines and paste this code.

Code:
Copy      Help
function [flags] ;;flags: 1 case insensitive

;EXAMPLE
;str s=
;;apple
;;apple
;;orange
;;apple
;;grape
;;orange
;
;s.RemoveDuplicateLines



if(!this.end("[]")) this+"[]"

str s ss
int i j
for i 0 1000000000
,j=s.getl(this i)
,if(j<0) break
,ss.from("[]" s "[]")
,this.findreplace(ss "[]" 8|(flags&1) "" j+s.len)


Attached Files
.doc   Select Record QM 2.doc (Size: 155 KB / Downloads: 223)
#3
in a word...

DANG!!!!!

8)


THANKS


Forum Jump:


Users browsing this thread: 1 Guest(s)