func init // adds using namespace sys.add_use('System.Text') // include external method if(linked("doAppendFormat2") or linked("doAppendFormat3")) sys.LoadMethod("ConvertArray_to_ArrayObject") end // initialize instance params = this.props('Constructor').value if(params == 'Constructor') params = '' elseif(params == 'Constructor2') params = '' + d("size") elseif(params == 'Constructor3') params = '' + d("Default") elseif(params == 'Constructor4') params = '' + d("size") + ', ' + d("maxCapacity") elseif(params == 'Constructor5') params = '' + d("Default") + ', ' + d("size") elseif(params == 'Constructor6') params = '' + d("Default") + ', ' + d("index") + ', ' + d("count") + ', ' + d("size") end sys.add_object(this.codename, 'StringBuilder', params) // initialize temp variable if(sys.is_linked(2) and (not user_level)) sys.add_var('temp', 'dynamic') end // initialize properties sys.set_undef_field('Capacity') sys.set_undef_field('Length') // make methods for properties sys._prop_init('Capacity', 1, 1, 1) sys._prop_init('Length', 1, 1, 1) sys._prop_init('MaxCapacity', 1, 0, 1) // makes implementation of methods as properties sys._mtd_as_prop_init('ToString()') sys._mtd_as_prop_init('StringBuilder') end func doConstructor() blk.println(this.codename, ' = new StringBuilder();') end func doConstructor2(size) blk.println(this.codename, ' = new StringBuilder(', d("size"), ');') end func doConstructor3(default) blk.println(this.codename, ' = new StringBuilder(', d("Default"), ');') end func doConstructor4(size, maxcapacity) blk.println(this.codename, ' = new StringBuilder(', d("size"), ', ', d("maxCapacity"), ');') end func doConstructor5(default, size) blk.println(this.codename, ' = new StringBuilder(', d("Default"), ', ', d("size"), ');') end func doConstructor6(default, startindex, count, size) blk.println(this.codename, ' = new StringBuilder(', d("Default"), ', ', d("startIndex"), ', ', d("count"), ', ', d("size"), ');') end func doAppend(data) if(linked("onResult")) if(user_level) event("onResult", this.codename + '.Append(' + d("Value") + ')') else blk.println(this.temp, ' = ', this.codename, '.Append(', d("Value"), ');') event("onResult", this.temp) end else blk.println(this.codename, '.Append(', d("Value"), ');') end end func doAppendFormat(data) if(linked("onResult")) if(user_level) event("onResult", this.codename + '.AppendFormat(' + d("Format") + ', ' + d("arg0") + ')') else blk.println(this.temp, ' = ', this.codename, '.AppendFormat(', d("Format"), ', ', d("arg0"), ');') event("onResult", this.temp) end else blk.println(this.codename, '.AppendFormat(', d("Format"), ', ', d("arg0"), ');') end end func doAppendFormat2(data) if(linked("onResult")) if(user_level) event("onResult", this.codename + '.AppendFormat(' + d("Format") + ', ConvertArray_to_ArrayObject(' + d("args") + '))') else blk.println(this.temp, ' = ', this.codename, '.AppendFormat(', d("Format"), ', ConvertArray_to_ArrayObject(', d("args"), '));') event("onResult", this.temp) end else blk.println(this.codename, '.AppendFormat(', d("Format"), ', ConvertArray_to_ArrayObject(', d("args"), '));') end end func doAppendFormat3(data) if(linked("onResult")) if(user_level) event("onResult", this.codename + '.AppendFormat(' + d("provider") + ', ' + d("Format") + ', ConvertArray_to_ArrayObject(' + d("args") + '))') else blk.println(this.temp, ' = ', this.codename, '.AppendFormat(', d("provider"), ', ', d("Format"), ', ConvertArray_to_ArrayObject(', d("args"), '));') event("onResult", this.temp) end else blk.println(this.codename, '.AppendFormat(', d("provider"), ', ', d("Format"), ', ConvertArray_to_ArrayObject(', d("args"), '));') end end func doAppendFormat4(data) if(linked("onResult")) if(user_level) event("onResult", this.codename + '.AppendFormat(' + d("Format") + ', ' + d("arg0") + ', ' + d("arg1") + ')') else blk.println(this.temp, ' = ', this.codename, '.AppendFormat(', d("Format"), ', ', d("arg0"), ', ', d("arg1"), ');') event("onResult", this.temp) end else blk.println(this.codename, '.AppendFormat(', d("Format"), ', ', d("arg0"), ', ', d("arg1"), ');') end end func doAppendFormat5(data) if(linked("onResult")) if(user_level) event("onResult", this.codename + '.AppendFormat(' + d("Format") + ', ' + d("arg0") + ', ' + d("arg1") + ', ' + d("arg2") + ')') else blk.println(this.temp, ' = ', this.codename, '.AppendFormat(', d("Format"), ', ', d("arg0"), ', ', d("arg1"), ', ', d("arg2"), ');') event("onResult", this.temp) end else blk.println(this.codename, '.AppendFormat(', d("Format"), ', ', d("arg0"), ', ', d("arg1"), ', ', d("arg2"), ');') end end func doAppendLine() if(linked("onResult")) if(user_level) event("onResult", this.codename + '.AppendLine()') else blk.println(this.temp, ' = ', this.codename, '.AppendLine();') event("onResult", this.temp) end else blk.println(this.codename, '.AppendLine();') end end func doAppendLine2(data) if(linked("onResult")) if(user_level) event("onResult", this.codename + '.AppendLine(' + d("Value") + ')') else blk.println(this.temp, ' = ', this.codename, '.AppendLine(', d("Value"), ');') event("onResult", this.temp) end else blk.println(this.codename, '.AppendLine(', d("Value"), ');') end end func doClear() if(linked("onResult")) if(user_level) event("onResult", this.codename + '.Clear()') else blk.println(this.temp, ' = ', this.codename, '.Clear();') event("onResult", this.temp) end else blk.println(this.codename, '.Clear();') end end func doEnsureCapacity(data) if(linked("onEnsureCapacity")) if(user_level) event("onEnsureCapacity", this.codename + '.EnsureCapacity(' + d("size") + ')') else blk.println(this.temp, ' = ', this.codename, '.EnsureCapacity(', d("size"), ');') event("onEnsureCapacity", this.temp) end else blk.println(this.codename, '.EnsureCapacity(', d("size"), ');') end end func doInsert(data) if(linked("onResult")) if(user_level) event("onResult", this.codename + '.Insert(' + d("index") + ', ' + d("Value") + ')') else blk.println(this.temp, ' = ', this.codename, '.Insert(', d("index"), ', ', d("Value"), ');') event("onResult", this.temp) end else blk.println(this.codename, '.Insert(', d("index"), ', ', d("Value"), ');') end end func doRemove(data) if(linked("onResult")) if(user_level) event("onResult", this.codename + '.Remove(' + d("index") + ', ' + d("count") + ')') else blk.println(this.temp, ' = ', this.codename, '.Remove(', d("index"), ', ', d("count"), ');') event("onResult", this.temp) end else blk.println(this.codename, '.Remove(', d("index"), ', ', d("count"), ');') end end func doReplace(data) if(linked("onResult")) if(user_level) event("onResult", this.codename + '.Replace(' + d("oldValue") + ', ' + d("newValue") + ')') else blk.println(this.temp, ' = ', this.codename, '.Replace(', d("oldValue"), ', ', d("newValue"), ');') event("onResult", this.temp) end else blk.println(this.codename, '.Replace(', d("oldValue"), ', ', d("newValue"), ');') end end func doReplace2(data) if(linked("onResult")) if(user_level) event("onResult", this.codename + '.Replace(' + d("oldValue") + ', ' + d("newValue") + ', ' + d("index") + ', ' + d("count") + ')') else blk.println(this.temp, ' = ', this.codename, '.Replace(', d("oldValue"), ', ', d("newValue"), ', ', d("index"), ', ', d("count"), ');') event("onResult", this.temp) end else blk.println(this.codename, '.Replace(', d("oldValue"), ', ', d("newValue"), ', ', d("index"), ', ', d("count"), ');') end end func Chars return(this.codename && '[' && d("index") && ']') end