title: "Unclassifiable statement" when referencing a function
body: <p>I'm learning about dummy arguments and local variables in functions.</p>
  
  <p>One of the exercises in the book I'm using is to write a program which asks the user for their first name and last name, then joins the names together and prints the full name. Here's the code:</p>
  
  <pre><code>PROGRAM name_test
      IMPLICIT NONE
  
      ! Declare variables
      CHARACTER(LEN=12) :: first, last
      CHARACTER(LEN=30), EXTERNAL :: full_name
  
      ! 1. Ask for first name and family name, then read them
      PRINT *, "Please enter your first name"
      READ *, first
      PRINT *, "Please enter your family name"
      READ *, last
  
      ! 2. Join names together
      full_name(first, last)
  
      ! 3. Print welcome message
      PRINT *, "Welcome ", full_name(first, last)
  
  END PROGRAM name_test
  
  CHARACTER(LEN=*) FUNCTION full_name(first_name, last_name)
      IMPLICIT NONE
  
      ! Function which joins 2 names to form a full name
  
      ! Dummy argument declarations
      CHARACTER(LEN=*), INTENT(IN) :: first_name, last_name
  
      ! Local variables
      CHARACTER(LEN=LEN(first_name)) :: new_first_name
      CHARACTER(LEN=LEN(last_name)) :: new_last_name
  
      ! Use ADJUSTL to remove redundant leading blanks
      new_first_name = ADJUSTL(first_name)
      new_last_name = ADJUSTL(last_name)
  
      ! Join names
      full_name = TRIM(new_first_name)//" "//new_last_name
  
  END FUNCTION full_name
  </code></pre>
  
  <p>When I try to compile, it comes up with an error referring to the function call at line 15:     </p>
  
  <pre><code>full_name(first, last)
  </code></pre>
  
  <p>This is the compile error:</p>
  
  <pre><code>Error: Unclassifiable statement at (1)
  </code></pre>