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


next up previous contents index
Next: regionmanager.union - Function Up: regionmanager - Tool Previous: regionmanager.setselectcallback - Function


regionmanager.type - Function



Package general
Module images
Tool regionmanager


Return the type of this tool


Synopsis
type()


Returns
String


Description
This function returns the string `regionmanager'. If you have a tool, but don't know what kind it is, this function usually exists to tell you that.



Example
- if (is_defined('thing') && is_record(thing) &&
+     has_field(thing, 'type') && is_function(thing.type) 
+     && thing.type() == 'regionmanager') {
+    print 'yippee'
+ } else {
+    print 'it is a sad day that we do not have a regionmanager'
+ };

Imagine we have been given a Glish variable called thing in some function but we can't guarentee its a Regionmanager, as expected. To write robust code, we need to check that it is. This bit of code does that. Note the use of the short cut ``&&'' operator. A statement is only evaluated if the statement to the left is true.





next up previous contents index
Next: regionmanager.union - Function Up: regionmanager - Tool Previous: regionmanager.setselectcallback - 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-08-01