func init // adds using namespace sys.add_use('System.Numerics') // initialize instance if(linked("Result") and linked("doOperation")) sys.add_var(this.name, 'dynamic') end end func doOperation(data) if(linked("Result")) blk.println(this.codename, ' = ', this.make_result(data), ';') event("onResult", this.codename) else event("onResult", this.make_result(data)) end end func make_result(data) op = this.props("OpType").value if(op == '-1') return('(-' + d("C1") + ')') elseif((op == '==') or (op == '!=')) return(sub('(' + d("C1") + ' ' + op + ' ' + d("C2") + ')', 104)) end return('(' + d("C1") + ' ' + op + ' ' + d("C2") + ')') end func Result if(linked("doOperation")) return(this.codename) else return(make_result()) end end