
Chapter 5: Creating an iTool 103
iTool Developer’s Guide Creating an iTool Launch Routine
Creating an iTool Launch Routine
An iTool launch routine is an IDL procedure that creates an instance of an iTool by
calling the IDLITSYS_CREATETOOL function. The launch routine may do other
things as well, including creating data objects to pass to the create function from
command-line arguments.
The process of creating an iTool launch routine is outlined in the following sections:
• “Specifying Command-Line Arguments and Keywords” on page 103
• “Creating Data Objects” on page 104
• “Handling Errors” on page 105
• “Creating an iTool Instance” on page 106
Specifying Command-Line Arguments and Keywords
If you want to be able to specify data to be loaded into your iTool when launching the
tool from the IDL command line, you must specify positional arguments or keywords
in the procedure definition. The procedure definition for an iTool launch routine may
look something like the following:
PRO myTool, A1, A2, MYKEYWORD = myKeys, IDENTIFIER = id, $
_EXTRA = _extra
Here, there are two positional parameters (or arguments) and three keyword
parameters are specified.
Arguments
Data arguments are specified in an iTool launch routine as with any IDL procedure.
See “Parameters” (Chapter 5, Application Programming) for details on arguments.
Keywords
Keyword arguments to an iTool launch routine are handled as with any IDL
procedure. See “Parameters” (Chapter 5, Application Programming) for details on
keyword arguments. In addition, you may want to include the following keyword
arguments in the definition of the launch routine:
The IDENTIFIER Keyword
The IDENTIFIER keyword is used to return the iTool system identifier string for the
newly created tool. You must set the variable specified by the IDENTIFIER keyword
equal to the return value of the IDLITSYS_CREATETOOL function. This allows the