[REBOL] Re: manipulating values in blocks
From: sunandadh:aol at: 27-Nov-2002 14:34
> is there anyone who knows how to manipulate the block into getting start
> end values of each segment ? I've tried, but don't know how to do this job.
Apologies if this isn't what you mean.....
segment-limit: func [b [block!] s [integer!]] [
;; trap out-of-range errors
if any [s > length? b
s < 1 ][
return [none none]]
return reduce [b/:s pick b (s + 1)]
] ;; func
;; test driver for segment limit function
myblock1: [1 17 23 36 49 58]
for nn -1 (2 + length? myblock1) 1 [
print [nn segment-limit myblock1 nn]