Re: duplicates of parts of a line in list

2014-08-03 Thread hh
Do you mean char 7 to 8?
And list 2 is not the result of this counting for list 1? Should be

08:00_d3_180_Monica_pink_1
10:45_d2_90_Mary_orange_6
10:00_d2_90_Mary_orange_6
10:15_d2_90_Mary_orange_6
10:30_d2_90_Mary_orange_6
10:00_d2_90_Mary_orange_6
10:00_d2_90_Mary_orange_6
12:30_d5_45_Mary_blue_3
12:45_d5_45_Mary_blue_3
12:60_d5_45_Mary_blue_3

If I got this right then try this:

function myCounter myList
 repeat for each line l in myList
   if l is empty then next repeat
   add 1 to f[char 1 to 2 of l comma char 7 to 8 of l]
 end repeat
 repeat for each line l in myList
   if l is empty then next repeat
   put cr  l  _  f[char 1 to 2 of l comma char 7 to 8 of l] after s
 end repeat
 delete char 1 of s -- is return
 return s
end myCounter


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: duplicates of parts of a line in list

2014-08-03 Thread hh
Sorru ell and one are hard to distinguish. SO

function myCounter myList
  repeat for each line i in myList
if i is empty then next repeat
add 1 to f[char 1 to 2 of i comma char 7 to 8 of i]
  end repeat
  repeat for each line i in myList
if i is empty then next repeat
put cr  i  _  f[char 1 to 2 of i comma char 7 to 8 of i] after s
  end repeat
  delete char 1 of s -- is return
  return s
end myCounter


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: duplicates of parts of a line in list

2014-08-03 Thread Jim sims
Very nice  :-)
Thank you!

sims

Can you explain what the  the f in the following line means/signifies?

   put cr  l  _  f[char 1 to 2 of l comma char 7 to 8 of l] after s




On Sun, Aug 3, 2014 at 1:03 PM, hh h...@livecode.org wrote:

 Do you mean char 7 to 8?
 And list 2 is not the result of this counting for list 1? Should be

 08:00_d3_180_Monica_pink_1
 10:45_d2_90_Mary_orange_6
 10:00_d2_90_Mary_orange_6
 10:15_d2_90_Mary_orange_6
 10:30_d2_90_Mary_orange_6
 10:00_d2_90_Mary_orange_6
 10:00_d2_90_Mary_orange_6
 12:30_d5_45_Mary_blue_3
 12:45_d5_45_Mary_blue_3
 12:60_d5_45_Mary_blue_3

 If I got this right then try this:

 function myCounter myList
  repeat for each line l in myList
if l is empty then next repeat
add 1 to f[char 1 to 2 of l comma char 7 to 8 of l]
  end repeat
  repeat for each line l in myList
if l is empty then next repeat
put cr  l  _  f[char 1 to 2 of l comma char 7 to 8 of l] after s
  end repeat
  delete char 1 of s -- is return
  return s
 end myCounter


 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: duplicates of parts of a line in list

2014-08-03 Thread hh
Never mind, just try:
put myCounter(fld X) into fld Y

That's life - more exactly, that's LiveCode:
s is an empty string, created by LC for you
f is an empty array variable, created by LC for you

Did you already look in the LC-forum? There is a lot of help and there are some 
impressively good helpers for such questions. I started there too at my very LC 
beginning, close to yesterday (time flows...). 

See you there, I'm only here today because its saturday (Craig?).

And there are very good tutorials to using arrays.
Both reachable from the top site of LiveCode.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode