/* Scriptol Example Simple class with one method Count occurence of a words in a string */ class Words int count(text base, text sea) int ctr = 0 int i = 0 while forever i = base.find(sea, i) if i = nil break i + 1 ctr + 1 /while return ctr /class Words demos text sample = "a b c de a hello a" print "Number of words:", demos.count(sample, "a")