Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1556
News FAQ
Search Home


next up previous contents index
Next: aipsrc.init - Function Up: aipsrc - Tool Previous: aipsrc.findint - Function


aipsrc.findlist - Function



Package utility
Module misc
Tool aipsrc


lookup a value in a code list


Synopsis
findlist(value, keyword, vlist, def)


Description
findlist will return T if the specified keyword was found in an aipsrc file and the value conformed to one in the list given, F otherwise. If a find was made, its value is compared with the codes given in a list (comparison is case insensitive, and only enough characters have to be in the value to give a unique match). The position in the list will be returned. If the keyword was not found, or if no match was found, a default value (if given) will be matched and its position returned. If the default is not given, or also does not match the code list, the returned value will be beyond the given list.



Example
With the following aipsrc keywords:
test.list:		ScR
test.list1:		test
The following will be the result:
- y := "none screen gui" 
- drc.findlist(x, 'test.list', y, 'gui')
T 
- x
2 
- drc.findlist(x, 'test.list1', y, 'gui')
F 
- x
3 
- drc.findlist(x, 'test.list1', y)        
F 
- x
4



Arguments

value   The value of the resource (Out)
    Allowed: Int
keyword   The name of the resource to look up (In)
    Allowed: String
vlist   List of code values that will be recognised
    Allowed: String array
def   Default value to use if keyword not present, or value does not match code value list
    Allowed: String
    Default: ''


Returns
Bool - is the resource defined and has correct code?




next up previous contents index
Next: aipsrc.init - Function Up: aipsrc - Tool Previous: aipsrc.findint - Function   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-10-15