func init // adds using namespace sys.add_use('System') // initialize instance if(linked("Result") and linked("doDivRem")) sys.add_var(this.name, 'dynamic') end // initialize type of the numbers this.type = (this.props("Type").value) ? 105 : 1 // initialize the remainder sys.add_var('rem', this.type) end func doDivRem(data) if(linked('Result')) blk.println(this.codename, ' = ', this.make_result(data), ';') event('onResult', sub(this.codename, this.type)) else event('onResult', this.make_result(data)) end end func make_result(data) res = 'Math.DivRem(' + sys.to_type(d("A"), this.type) + ', ' + sys.to_type(d("B"), this.type) + ', out ' + this.rem + ')' return(sub(res, this.type)) end func Result if(linked("doDivRem")) return(sub(this.codename, this.type)) else return(make_result()) end end func Remainder return(sub(this.rem, this.type)) end