Fortran 77: Reading empty string



I've written a simple finite automata simulator in Fortran 77, which
works except that I cannot successfully read in and process the empty
string. I've tried the following code, and in my READ statement I
supplied the END=13 which means "if the user just presses enter, goto
line 13". That means just proceed as normal...passing the empty string
to the FA function should work, but I haven't gotten a chance to test
it because although the code compiles using g77, I get a runtime error
which follows my code.

PROGRAM FASimulator

CHARACTER*25 str

10 WRITE(6,11)
11 FORMAT(1x, 'String: ', $)

READ(*, END=13) str

13 IF (FA(str).EQ.1) THEN
PRINT *, 'accepted'
ELSE
PRINT *, 'rejected'
END IF

GOTO 10

STOP
END
-----------------------------
natica% !g
g77 program2.f -o program2
natica% !.
../program2
String: sue: unformatted io not allowed
apparent state: unit 5 (unnamed)
lately reading sequential unformatted external IO
Abort

.



Relevant Pages

  • Re: Exporting excel to text file
    ... filenumber is just a new local variable which is going to hold the system ... >> Thank you so much for your help, the While statement and empty is ... The selection may very large as compared to what is ... >> 'Walk down each row and include it in the string if the cell is not ...
    (microsoft.public.excel.misc)
  • Re: A Logical Model for Lists as Relations
    ... I am aware of the difference between the number zero and an empty list. ... contents of a set - yields a bunch, which also has a comma union ... is a string of length 4. ... Empty strings and empty lists? ...
    (comp.databases.theory)
  • Re: Exporting excel to text file
    ... >> Thank you so much for your help, the While statement and empty is ... The selection may very large as compared to what is ... >> Open Filename For Output As #filenumber ... >> 'Walk down each row and include it in the string if the cell is not ...
    (microsoft.public.excel.misc)
  • Re: So whats null then if its not nothing?
    ... explain how an empty string differs from a NULL string? ... The number ZERO is the identity over the operation of addition. ... A similar evolution happened to the ASCII NUL ). ...
    (comp.databases.theory)
  • Re: So whats null then if its not nothing?
    ... explain how an empty string differs from a NULL string? ... > The number ZERO is the identity over the operation of addition. ... NUL was used to indicate "tape feed". ...
    (comp.databases.theory)