Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: manipulating values in blocks

From: sunandadh:aol at: 27-Nov-2002 14:34

Hugues
> is there anyone who knows how to manipulate the block into getting start
and
> 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] ] Sunanda.