func init // adds using namespace sys.add_use('System') // initialize instance if(linked("Result") and linked("doSign")) sys.add_var(this.name, 1) end // initialize type of the number this.type = this.get_type(this.props("Type").value) end func get_type(t) if(t == 0) return(7) elseif(t == 1) return(108) elseif(t == 2) return(1) elseif(t == 3) return(105) elseif(t == 4) return(107) end end func doSign(value) if(linked('Result')) blk.println(this.codename, ' = ', this.make_result(value), ';') event('onResult', this.codename) else event('onResult', this.make_result(value)) end end func make_result(value) return('Math.Sign(' + sys.to_type(d("Value"), this.type) + ')') end func Result if(linked("doSign")) return(this.codename) else return(make_result()) end end