Re: How to detect NULL input?



That worked for the string comparison with everything except NULL.
Maybe I goofed something up in the main. The whole program is below.
Did I goof something up?

program test
implicit none
CHARACTER(12) fname
CHARACTER(12) evaluateinput
C CHARACTER(*) fname
C CHARACTER(*) evaluateinput

100 WRITE (*, 101)
101 format ('String: ', $ )
READ (*, *) fname
print *, 'Test ',evaluateinput(fname)
END program

function evaluateinput(str1) result(string)
implicit none
character(*) str1
character(*) string
string = 'world'
if (str1 .EQ. '') then
string = 'equal'
else
string = 'not equal'
end if
return
end

.



Relevant Pages

  • Re: How to detect NULL input?
    ... CHARACTERfname ... CHARACTER(*) evaluateinput ... implicit none characterstr1 ... characterstring string = 'world' if (str1 .EQ. ...
    (comp.lang.fortran)
  • Re: SQL issue?
    ... Here is how you do it from the format of the data you have provided ... Look for the First _ character from the left of the string. ... > I have column FName of varchar type. ...
    (microsoft.public.sqlserver.dts)
  • Re: How to detect NULL input?
    ... >>>That worked for the string comparison with everything except NULL. ... CHARACTERfname ... CHARACTER(*) evaluateinput ... >> You need to replace the END program statement by a CONTAINS ...
    (comp.lang.fortran)
  • Re: How to detect NULL input?
    ... I'm not sure what happens if you compare against one - I'm slightly surprised it gets past an F77 compiler. ... CHARACTERfname ... CHARACTER(*) fname ... characterstring ...
    (comp.lang.fortran)
  • RfD: Escaped Strings version 4
    ... the S" string can only contain printable characters, ... the S" string cannot contain the '"' character, ... as an escape character for the entry of characters that cannot be ... \b BS (backspace, ASCII 8) ...
    (comp.lang.forth)