func init // adds using namespace sys.add_use('System') // initialize instance this.type = this.props("Mode").value if(linked("Result") and linked("doConvert")) sys.add_var_extern(this.name, this.type) end if(linked("onError")) this.setfield('ex', 'ex' + this.id) end this.typecode = sys.type_code(this.type) end func make_conv(data) return('Convert.To' && this.props("Mode").value + '(' + d("Data") + ')') end func doConvert(data) linked("onError") ? blk.println('try {').inc() : '' if(linked("Result")) blk.println(this.codename, ' = ', make_conv(data), ';') event("onResult", sub(this.codename, this.typecode)) else event("onResult", sub(make_conv(data), this.typecode)) end if(linked("onError")) blk.dec().println('} catch(Exception ', this.ex, ') {').inc() event("onError", this.ex + '.Message') blk.dec().println('}') end end func Result if(linked("doConvert")) return(sub(this.codename, this.typecode)) else return(sub(make_conv(), this.typecode)) end end