func init // add using module sys.add_use('System.Runtime.InteropServices') // include external classes sys.LoadMethod("TagFind") // initialize instance if(linked("doFind") and (linked("Result") or linked("onNotFound"))) sys.add_var(this.name, 'string') end end func make_find(data) return('TagFind(' + d("Source") + ', ' + d("StartTag") + ', ' + d("EndTag") + ', ' + d("StartIndex") + ', ' + lower(this.props("Greedy").value) + ')') end func doFind(data) if(linked("onNotFound")) blk.println(this.codename, ' = ', make_find(data), ';') .println('if (', this.codename,' == string.Empty) {').inc() event("onNotFound") blk.dec().println('} else {').inc() event("onResult", this.codename) blk.dec().println('}') else if(linked("Result")) blk.println(this.codename, ' = ', make_find(data), ';') event("onResult", this.codename) else event("onResult", make_find(data)) end end end func Result if(linked("doFind")) return(this.codename) else return(make_find()) end end