Home | Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]

Creating a Simple Program


In this section, we'll create a simple "Hello World" program consisting of two .pro files:

  1. Start the IDLDE.
  2. Start the IDL Editor by selecting File ® New or clicking the New File button on the toolbar.
  3. Type the following in the IDL Editor window:
  4. PRO hello_main 
       name = '' 
       READ, name, PROMPT='Enter Name: ' 
       str = HELLO_WHO(name) 
       PRINT, str 
    END 
    
  5. To save the file, select File ® Save or click Save button on the toolbar. Save the file with the name hello_main.pro in the main IDL directory (which the Save As dialog should already show).
  6. Open a new Editor window by selecting File ® New, and enter the following code:
  7. FUNCTION hello_who, who 
       RETURN, 'Hello ' + who 
    END 
    
  8. Save the file as hello_who.pro in the main IDL directory.

We now have a simple program consisting of a user-defined procedure, which calls a user-defined function.


Home | Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]