title: Fortran Character Input at Undefined Length
body: <pre><code>program Test
  
  implicit none
  character (LEN=100) :: input
  character (LEN=100) :: output
  print *,"Please input your message: "
  read *, input
  </code></pre>
  
  <p>For every character, I encrypt it in Ceaser's Cipher</p>
  
  <p><em>Calculations</em></p>
  
  <pre><code>print *,"This is the output: "
  write (*,"(2a)") "Message = ", out
  
  end program Test
  </code></pre>
  
  <p>This doesn't work entirely. </p>
  
  <p>For every character in the input, I convert it using the modulo(iachar()) functions. It works up until the print, I followed the debugging, the encryption is fine.
  But the issue with the output lies in LEN=100. The do loop will go through 100 times converting nonexistent characters into garbage, breaking the program at output with UNDEFINED TYPE.</p>
  
  <p>So if I input "test", it will encrypt CBNC*GARBAGE-TO-100* and not output. If I define length as 4, and do it, it works. but I want to be able to do it without defining a length. Any way around this?</p>