Choosing and adapting your editor is very important, the editor is
 your primary tool, and you will spend a lot of hours working with it,
 making it easy to use will be worthwhile.

 Adapting the editor for FORTRAN programming consists of:

   1) Beginning a code line
   2) Inserting a separator line
   3) Inserting a procedure header
   4) Using form-feeds
   5) Setting a proper tab step

 Beginning a code line
 FORTRAN 77 code lines may begin on column 1 (statement labels) 
 column 6 (continuation marks) or column 7 (statements).

 Most often you begin on column 7, so if you define the ENTER key 
 to send the following sequence:

                RETURN + (6 * SPACE)

 You will be able to start a new line with one key stroke (Using a 
 tab is non-standard!) and save typing those endless spaces.

 To get to column 6 press ENTER and backspace one character.
 To get to column 1 just press RETURN

 Of course you don't need such key definition for Fortran 90 free-form.

 Inserting a separator line
 Separator lines are comment lines like this:

C     ------------------------------------------------------------------
C     ==================================================================

 The first dash (equal sign) is on column 7 and the last on column 72, 
 so you can easily see if nearby code lines got out of the allowed area, 
 a popular mistake that sometimes is hard to trace. 

 The separator line is useful when you arrange code for readability.

 You should define key combinations that will insert separator lines.

 See the program layout section for examples.

 Inserting a procedure header
 A procedure header is a text segment looking like this:

C     +-----------------------------------------------------------------
C     |  Procedure:*******
C     |  Author:**********
C     |  Update:**********
C     |  Redistribution:**
C     +-----------------------------------------------------------------
C     |  Description:**
C     |  **************
C     |  **************
C     |  **************
C     +-----------------------------------------------------------------

 The asterisks '*' denote spaces, they make easier filling this 'form'

 You should define a key combination that will insert a procedure 
 header (include a file with this text).

 Using form-feeds
 The form-feed character is ASCII character number 12.

 When printers encounter this character they start a new page of paper.

 Some editors (like eve, EDT) defines by default a key that jumps from 
 one form-feed character to the next (previous) one. Editors that doesn't 
 define such a key by default can usually be made to do so.

 You can insert a line containing only a form-feed at the beginning of 
 procedures, then you can easily page through your procedures, and if 
 you print your program each procedure will begin on a new paper page.

 Setting a proper tab step
 A proper tab step is in the range 2-4, a higher value would 
 have improved readability, but with FORTRAN 77 limited code 
 area (columns 7-72), a few extra identation level may leave
 you with no space for the code.

 Adapting VMS editors
 VMS provides many editors, the EDIT/TPU editor (nicknamed 'EVE') 
 and the Language Sensitive Editor (LSE) based on it are recommended. 

 You will have to create a shared/private EVE section/command file 
 and add some lines to your SYS$LOGIN:LOGIN.COM file. Try to avoid 
 using initialization files as they slow down editor invocation.

 Send mail to:  agay@vms.huji.ac.il  for more information.

 UNIX's in general
        'vi' is a powerful editor, alas not a very friendly one.
        Emacs can do everything, it has also a Fortran mode.

        'jot' is very primitive, new versions of IRIX are supposed to
        have the 'zip' editor (old ones can easily install it), which 
        is quite good.

Return to contents page