func init // adds using namespace sys.add_use('System') // initialize instance if(linked("Result")) sys.add_var(this.name, 1) end // gets type of an array if(isdef("ElementType")) this.type = 'Object' else this.type = code(this.props("ElementType").value.props("TypeName").value) if(this.type == 'Object undefined') error(this.name + ' - property ' + this.props("ElementType").name + ' does not defined') this.type = 'Object' end end end func doIndexOf(array, value) if(linked("Result")) blk.println(this.codename, ' = Array.IndexOf', isdef("ElementType") ? '' : '<' + this.type + '>', '(', d("Array"), ', ', d("Value"), ');') event("onResult", this.codename) else event("onResult", 'Array.IndexOf' + (isdef("ElementType") ? '' : '<' + this.type + '>') + '(' + d("Array") + ', ' + d("Value") + ')') end end func doIndexOf2(array, value, startIndex) if(linked("Result")) blk.println(this.codename, ' = Array.IndexOf', isdef("ElementType") ? '' : '<' + this.type + '>', '(', d("Array"), ', ', d("Value"), ', ', d("StartIndex"), ');') event("onResult", this.codename) else event("onResult", 'Array.IndexOf' + (isdef("ElementType") ? '' : '<' + this.type + '>') + '(' + d("Array") + ', ' + d("Value") + ', ' + d("StartIndex") + ')') end end func doIndexOf3(array, value, startIndex, length) if(linked("Result")) blk.println(this.codename, ' = Array.IndexOf', isdef("ElementType") ? '' : '<' + this.type + '>', '(', d("Array"), ', ', d("Value"), ', ', d("StartIndex"), ', ', d("Length"), ');') event("onResult", this.codename) else event("onResult", 'Array.IndexOf' + (isdef("ElementType") ? '' : '<' + this.type + '>') + '(' + d("Array") + ', ' + d("Value") + ', ' + d("StartIndex") + ', ' + d("Length") + ')') end end func Result return(this.codename) end