Re: type checking ?
- Posted by Pete Lomax <petelomax at blu??onder.co.uk> Nov 25, 2007
- 630 views
I wrote: > }}} <eucode> > global function getstr(integer idx) -- or make defset global > if idx<1 or idx> length(defset) then ?9/0 end if > return defset[idx] > end function > procedure useit(integer idx) > </eucode> {{{ My OCD says: better typewise/error reporting is of course:
global type valididx(object idx) return integer(idx) and idx>= and idx<= length(defset) end type global function getstr(integer idx) return defset[idx] end function procedure useit(valididx idx)
Thataway any error should occur on the useit call itself, not two levels down in the call stack... Pete