topmake_selection
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
names = [ 'Alfred','Anton','Peter','John','Mary']
index = MAKE_SELECTION(names,['Peter','Mary'])
print,index
; prints 2 4
vals = indgen(20)
index = MAKE_SELECTION(vals,[9,-5,8,7,7,8,9])
print,index
; prints 9 -1 8 7 7 8 9
index = MAKE_SELECTION(vals,[9,-5,8,7,7,8,9],/ONLY_VALID)
print,index
; prints 9 8 7 7 8 9
index = MAKE_SELECTION(vals,[9,-5,8,7,7,8,9],/REQUIRED)
print,index
; prints -1
Version history
Version
$Id: make_selection.pro 163 2006-08-29 12:59:46Z navarro $
History
mgs, 28 Aug 1998: VERSION 1.00
mgs, 29 Aug 1998: - changed behavior and added ONLY_VALID keyword
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 |