topmake_selection
tools
Return value
A (long) array with indexes to reference the selected values
in the NAMES array.
Parameters
names
in
required
selnames
in
required
Keywords
ONLY_VALID
REQUIRED
QUIET
Examples
IDL> names = [ 'Alfred','Anton','Peter','John','Mary']
IDL> index = MAKE_SELECTION(names,['Peter','Mary'])
IDL> print,index
2 4
IDL> vals = indgen(20)
IDL> index = MAKE_SELECTION(vals,[9,-5,8,7,7,8,9])
IDL> print,index
9 -1 8 7 7 8 9
IDL> index = MAKE_SELECTION(vals,[9,-5,8,7,7,8,9],/ONLY_VALID)
IDL> print,index
9 8 7 7 8 9
IDL> index = MAKE_SELECTION(vals,[9,-5,8,7,7,8,9],/REQUIRED)
IDL> print,index
-1
IDL> index = MAKE_SELECTION(vals,[9,-5,8,7,7,8,9],/REQUIRED,/QUIET)
% MAKE_SELECTION: Selected name not found in names array (-5)!
IDL> print,index
-1
Version history
Version
$Id: make_selection.pro 372 2008-08-08 12:31:53Z pinsard $
History
mgs, 28 Aug 1998: VERSION 1.00
mgs, 29 Aug 1998: - changed behavior and added ONLY_VALID keyword
Copyright (C) 1998, Martin Schultz, Harvard University
This software is provided as is without any warranty
whatsoever. It may be freely used, copied or distributed
for non-commercial purposes. This copyright notice must be
kept with any copy of this software. If this software shall
be used commercially or sold as part of a larger package,
please contact the author to arrange payment.
Bugs and comments should be directed to mgs@io.harvard.edu
with subject "IDL routine make_selection"
Known issues
Restrictions
If the NAMES array contains multiple entries of the same value,
only the index to the first entry will be returned.
A selection can contain multiple instances of the same value.
The index array will contain one entry per selected item
(See example below)
Statistics
McCabe cyclic | 8 |
McCabe essential | 1 |
McCabe modular design | 1 |