[REBOL] Picks
From: andrew::martin::colenso::school::nz at: 12-Aug-2003 17:49
For those times, when there just isn't enough pick... :)
Here's my nifty function of the day:
Picks: func [
{Returns the values at the specified positions in the series.}
Series [series! pair! event! money! date! time! object! port!
tuple! any-function!]
Indexes [block!]
] [
foreach Index Indexes collect/only [
pick Series Index
]
]
And I use it like this:
transpose Picks transpose Table [1 2 5 6 8 9 11 12 14 15
17 18]
to pick out columns from a table by index number.
Andrew J Martin
Attendance Officer &
Information Systems Trouble Shooter
Colenso High School
Arnold Street, Napier.
Tel: 64-6-8310180 ext 826
Fax: 64-6-8336759
http://colenso.net/scripts/Wiki.r?AJM
http://www.colenso.school.nz/
DISCLAIMER: Colenso High School and its Board of Trustees is not responsible (or legally
liable) for materials distributed to or acquired from user e-mail accounts. You can report
any
misuse of an e-mail account to our ICT Manager and the complaint will be investigated.
(Misuse can come in many forms, but can be viewed as any material sent/received that
indicate or suggest pornography, unethical or illegal solicitation, racism, sexism, inappropriate
language and/or other issues described in our Acceptable Use Policy.)
All outgoing messages are certified virus-free by McAfee GroupShield Exchange 5.10.285.0
Phone: +64 6 843 5095 or Fax: +64 6 833 6759 or E-mail: [postmaster--colenso--school--nz]