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 doBinarySearch(array, value) if(linked("Result")) blk.println(this.codename, ' = Array.BinarySearch', isdef("ElementType") ? '' : '<' + this.type + '>', '(', d("Array"), ', ', d("Value"), ');') event("onResult", this.codename) else event("onResult", 'Array.BinarySearch' + (isdef("ElementType") ? '' : '<' + this.type + '>') + '(' + d("Array") + ', ' + d("Value") + ')') end end func doBinarySearch2(array, value, comparer) if(linked("Result")) blk.println(this.codename, ' = Array.BinarySearch', isdef("ElementType") ? '' : '<' + this.type + '>', '(', d("Array"), ', ', d("Value"), ', ', d("Comparer"), ');') event("onResult", this.codename) else event("onResult", 'Array.BinarySearch' + (isdef("ElementType") ? '' : '<' + this.type + '>') + '(' + d("Array") + ', ' + d("Value") + ', ' + d("Comparer") + ')') end end func doBinarySearch3(array, index, length, value) if(linked("Result")) blk.println(this.codename, ' = Array.BinarySearch', isdef("ElementType") ? '' : '<' + this.type + '>', '(', d("Array"), ', ', d("Index"), ', ', d("Length"), ', ', d("Value"), ');') event("onResult", this.codename) else event("onResult", 'Array.BinarySearch' + (isdef("ElementType") ? '' : '<' + this.type + '>') + '(' + d("Array") + ', ' + d("Index") + ', ' + d("Length") + ', ' + d("Value") + ')') end end func doBinarySearch4(array, index, length, value, comparer) if(linked("Result")) blk.println(this.codename, ' = Array.BinarySearch', isdef("ElementType") ? '' : '<' + this.type + '>', '(', d("Array"), ', ', d("Index"), ', ', d("Length"), ', ', d("Value"), ', ', d("Comparer"), ');') event("onResult", this.codename) else event("onResult", 'Array.BinarySearch' + (isdef("ElementType") ? '' : '<' + this.type + '>') + '(' + d("Array") + ', ' + d("Index") + ', ' + d("Length") + ', ' + d("Value") + ', ' + d("Comparer") + ')') end end func Result return(this.codename) end