Re: Counting and numbering duplicates in a list

2011-09-29 Thread Peter M. Brigham, MD
On Sep 29, 2011, at 8:00 AM, Roger Eller wrote: > Good morning all, > > Thank you all for the juicy brain nuggets! They look great, and I can't > wait to try them. Arrays are still a bit of a mystery to me, but I'm always > reading great things about the speed gains when used, so... I'm off to

Re: Counting and numbering duplicates in a list

2011-09-29 Thread Roger Eller
Good morning all, Thank you all for the juicy brain nuggets! They look great, and I can't wait to try them. Arrays are still a bit of a mystery to me, but I'm always reading great things about the speed gains when used, so... I'm off to do some tests... Thanks everyone! ˜Roger

Re: Counting and numbering duplicates in a list

2011-09-28 Thread Pete
Where are this list of keys coming from? If from an SQL database, this could be done with an SQL SELECT statement with no need to write LC code. Don't know if it would be faster than LC without more information. Pete Molly's Revenge On Wed, Sep 28, 2011 at 11:28

Re: Counting and numbering duplicates in a list

2011-09-28 Thread Jan Schenkel
mp; PDF Library for LiveCode www.quartam.com = "As we grow older, we grow both wiser and more foolish at the same time." (La Rochefoucauld) - Original Message ----- From: "Peter M. Brigham, MD" To: How to use LiveCode Cc: Sent: Thursday, September 29, 2011 5:55 AM Subj

Re: Counting and numbering duplicates in a list

2011-09-28 Thread dunbarx
: How to use LiveCode Sent: Wed, Sep 28, 2011 6:53 pm Subject: Counting and numbering duplicates in a list There are several ways I could approach this, but I'm unsure which way is best? I have a list of numbers that 'may' contain duplicates. I need to sequence ONLY the duplicates w

Re: Counting and numbering duplicates in a list

2011-09-28 Thread Peter M. Brigham, MD
Just timed the script below using a 1 (10^4) line list -- 1.964 seconds. Not great if you're dealing with >= 10^5 items. Can someone do better? -- Peter Peter M. Brigham pmb...@gmail.com http://home.comcast.net/~pmbrig > function flagDupes tList > put tList into scratchList > repeat for

Re: Counting and numbering duplicates in a list

2011-09-28 Thread Peter M. Brigham, MD
function flagDupes tList put tList into scratchList repeat for each line t in tList if t is among the lines of scratchList or \ freqArray[t] > 0 then add 1 to freqArray[t] put cr & t & "-" & freqArray[t] after outputList else put cr & t afte

Re: Counting and numbering duplicates in a list

2011-09-28 Thread Ian McKnight
Hi Roger My first thought would be to set up an array having your numbers as keys. Cycle through each key counting the occurrence of each number in your master list and then separate out the key values that are greater than one. Use the offset function to reference each value in the master list -

Re: Counting and numbering duplicates in a list

2011-09-28 Thread Monte Goulding
On 29/09/2011, at 12:52 PM, Roger Eller wrote: > There are several ways I could approach this, but I'm unsure which way is > best? I have a list of numbers that 'may' contain duplicates. I need to > sequence ONLY the duplicates without changing the order the list. If there > is only one, it doe

Counting and numbering duplicates in a list

2011-09-28 Thread Roger Eller
There are several ways I could approach this, but I'm unsure which way is best? I have a list of numbers that 'may' contain duplicates. I need to sequence ONLY the duplicates without changing the order the list. If there is only one, it does not need to be sequenced. Should I just repeat, and ke