Page 2 of 2

Re: Duplicate Remover

Posted: Sun May 07, 2023 10:29 pm
by rkriesel
The split command seems to ignore the caseSensitive property for the keys but instead apply it to the values.
The following test shows the wrong results in variable t.

Code: Select all

command foo
   local t
   put "A,B" & cr & "a,b" into t
   set caseSensitive to false
   split t by cr and ""
   breakpoint
end foo
I tested using 9.6.9.
How about filing a bug report, trevix?
-- Dick
trevix wrote:
Sun May 07, 2023 9:36 pm
Interesting:
removing duplicates from a list using

Code: Select all

split pList by cr and "" 
combine pList by cr and "
does not remove duplicates that differentiate by having a capital char in the name, even setting the caseSensitive to false before the code

Re: Duplicate Remover

Posted: Mon May 08, 2023 8:19 am
by trevix

Re: Duplicate Remover

Posted: Wed May 10, 2023 10:02 pm
by bn
trevix wrote:
Mon May 08, 2023 8:19 am
done:
https://quality.livecode.com/show_bug.cgi?id=24215
Hi Trevi,

You can try this

Code: Select all

on mouseUp
   local tVar, tVar2
   put "A,B" & cr & "a,b" & cr & "a,b" into tVar
   split tVar by cr as set
   put the keys of tVar into tVar2
   put tVar2
end mouseUp
This seems to be case insensitive.

Kind regards
Bernd

Re: Duplicate Remover

Posted: Wed May 10, 2023 11:55 pm
by bn
trevix wrote:
Sun May 07, 2023 9:36 pm
Interesting:
removing duplicates from a list using

Code: Select all

split pList by cr and "" 
combine pList by cr and "
does not remove duplicates that differentiate by having a capital char in the name, even setting the caseSensitive to false before the code
Hi Trevi,

You could also force the list to be all upper/lower case:

Code: Select all

   put toLower(pList) into pList
   split pList by cr and "" 
   combine pList by cr and ""
Kind regards
Bernd

Re: Duplicate Remover SOLVED

Posted: Thu May 11, 2023 7:52 am
by trevix
Cleaver :shock:
Thanks

Code: Select all

on mouseUp
   local tVar, tVar2
   put "A,B" & cr & "a,b" & cr & "a,b" into tVar
   split tVar by cr as set
   put the keys of tVar into tVar2
   put tVar2
end mouseUp