Economy-x-Talk - Sample Scripts
Count Instances
A quick way to count all instances of a particular string in a particular item on all lines of the data in a variable.
function countInstances theItem,theData
sort lines of theData by item 4 of each
put lineOffset(comma & theItem & comma,theData) into myFirst
put myFirst into myLast
repeat until item 4 of line myLast is not theItem
add 1 to myLast
end repeat
return (myLast - myFirst)
end countInstances
Keep this extensive resource of tutorials and samples on-line! Support RunRev.info!
| Yes, this script is useful. I make a donation and choose freely how much I want to donate on-line (PayPal). Click here if you want to make a donation in dollars. | This script has not (completely) solved my problem and I want Economy-x-Talk to take care of it. Let me contact you. |
Copyright©2002-2008 by Mark Schonewille, Nijmegen, the Netherlands. This web site is in no way affiliated with Runtime Revolution Ltd., but we do recommend the Revolution development platform.