Duplicate Remover

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

rkriesel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 118
Joined: Thu Apr 13, 2006 6:25 pm

Re: Duplicate Remover

Post by rkriesel » Sun May 07, 2023 10:29 pm

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

trevix
Posts: 966
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

Re: Duplicate Remover

Post by trevix » Mon May 08, 2023 8:19 am

Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4016
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Duplicate Remover

Post by bn » Wed May 10, 2023 10:02 pm

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

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4016
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Duplicate Remover

Post by bn » Wed May 10, 2023 11:55 pm

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

trevix
Posts: 966
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

Re: Duplicate Remover SOLVED

Post by trevix » Thu May 11, 2023 7:52 am

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
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”