Re: Re[2]: (Another) (small) Eu 2.5 feature request.
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Sep 24, 2004
- 489 views
On Thu, 23 Sep 2004 17:37:18 -0700, Hayden McKay <guest at RapidEuphoria.com> wrote: >However it would be nice to be able to do this; >}}} <eucode> >sequence array array = repeat(0, 10) >sequence slice sclice = array[5..2] ></eucode> {{{ Why? what (typo aside) is slice? array[2..5]? how about: function ews(sequence s, integer fromidx, integer toidx) -- either way slice: if fromidx>toidx then return s[toidx..fromidx] end if return s[fromidx..toidx] end function slice=ews(array,5,2) >I had an idea for type checking constants. >}}} <eucode> >type word(integer value) > return <= #FFFF >end type >constant VALUE = word(12345) ></eucode> {{{ > >I've decided against this one too because constants are allways static >but it might help for local variables eg; >}}} <eucode> >integer value value = word(12345) ></eucode> {{{ obviously you meant word value value=12345 <BSG> Regards, Pete