Startup File
A startup file is a batch file that is executed automatically each time the IDL is started. The name of the startup file is specified by the IDL_STARTUP preference. You can set the value of this preference manually (see IDL System Preferences (IDL Reference Guide) for information on IDL's preferences system) or using the "IDL" page of the IDL Workbench Preferences dialog.
Common uses for startup files include the following:
Startup files are executed one statement at a time. It is not possible to define program modules (procedures, functions, or main-level programs) in the startup file. For more information on creating batch files, see Executing Batch Jobs in IDL (Application Programming).
Understanding When Startup Files are Not Executed
Startup files are executed only when a command line is present. (Prior to IDL 6.2, IDL would execute the startup file specified by the environment variable IDL_STARTUP even if no IDL command line was present.) Now, however, the startup file is not executed when running the following types of applications:
In most cases the new behavior is desirable; you as the developer of an IDL application do not necessarily know whether the end user of your application has an IDL startup file.
If, however, you are creating an application that relies on settings defined in a startup file, you have the following options:
- Use the IDL preferences system, rather than a startup file, to set the appropriate values. This option is only available if the values being defined in the startup file correspond to IDL preferences.
- If your application is not a Virtual Machine or Runtime IDL application, explicitly execute the startup file after your IDL session has begun. See the following section for details.
Manually Executing a Startup File
To explicitly execute the startup file after an IDL process has been started (either through the IDL_IDLBridge object or a Connectivity Bridge wrapper object), complete the following steps: