Still, we all discover
Since the BC-FORTRAN77 compiler outputs error messages in German,
here are some of the more common error messages:
A special case are thr Input/Output (I/O) errors. They take the form: Have Fun.
Useful compiler options
Most Fortran compilers will have a set of options you can turn on
if you like. The following compiler options are specific to the
BC-FORTRAN77 compiler, but most compilers will have similar
options (although the letters may be different).
You can use /Option instead of -Option.
-D Debug: equivalent to -BVL
-B deBugcode: implies -H and also produces debugger calls for
examination of field borders and substrings.
-H parcHeck: produces code for examination of parameter lists
and checks of stack overruns
-V Varlist: List of variables for debugger
-L Lineslist: Line number list for debugger
-U Uppercase: Changes lower-case into upper case characters (even
in character constants and formats). Without this
option xy, XY, Xy and xY are four different
variables!
-F Free input: Source program is not in FORTRAN format. Non-standard!
-P Protocol: registry of the compiled lines.
-S Short protocol: One line per module with the size of the stack
frame and code in bytes.
-O One: produces one output file with name of the first
input file.
Some common errors
Here are some common errors to watch out for:
Debugging tools
If you have a bug, you have to try to locate it. Syntax errors are
easy to find. The problem is when you have run-time errors.
The old-fashioned way to find errors is to add write statements
in your code and try to track the values of your variables.
This is a bit tedious since you have to recompile your source code
every time you change the program slightly. BC-FORTRAN77 has a
debugger which is a convient tool. You can step through
a program line by line , you can
display the values of the variables you want to monitor, and much more.
When the program has been compiled with the -D option, a run time error
will give an error message and wait for a command.
The debugger can also be activated by a key-stroke interrupting
the program's execution if the program was created with the B
option. The following keys are recognized by the debugger as
commands:
Note on Error Messages
# Description
--- -----------
200 Unrecognized statement
201 Declaration not allowed here
203 Multiply defined label
252 Illegal expression
253 Equals sign expected
282 Undefined label
The format of the compiler error messages is the error number followed by the
error description (in German). On the next line is the string which was being
scanned when the error was encountered, followed by the line number where the
error was noticed.
IO-Error: Number
Input/output errors may be intercepted by placing the IOSTAT= parameter in the
IO statement. The number has the same value as is returned in the IOSTAT
variable.
Number:
-1 End of File
-2 End of File in middle of record.
1 File number already in use (OPEN)
2 Too many files (OPEN). Max. is 32
3 File name too long (OPEN). Max is 32 characters.
5 File number not opened. Only file numbers 5 and 6 can be
used with being OPENed
6 formatted/unformatted contradiction
7 REC parameter for file with ACCESS='SEQUENTIAL'
8 BACKSPACE, REWIND, ENDFILE are not possible for files AUX: and PRN:
10 Internal I/O is formatted only
20 INTEGER overflow
21 Data error by the listing generator input, e.g. missing
apostrophe for a symbol link
22 unexpected end of data
23 record too long
24 UNFORMATTED SEQUENTIAL read error
30 IO list element doesn't match format element.
INTEGER needs I format
REAL, DOUBLE PRECISION (COMPLEX) need one or two F, G, E or
D format elements
31 Format element L: T or F expected (input)
32 format element I: unexpected characters (input). Null
characters, signs and numerics allowed.
33 format element E, F or D unexpected characters (input
null characters, signs, numerics, decimal point, E, e, D or
d (for the exponent) allowed.
34 too many ( in format
35 too many ) in format
36 numeric character in a disallowed place in format
37 illegal format element
38 decimal point error in F, E, G, or D format element
39 4Htext or 'text' in format for READ. In FORTRAN66 this was
allowed as a way to read in text but in FORTRAN77 this is
no longer allowed.
40 exponent too large for the given format.
42 format element too long. Must be less than the internal
record buffer size (80 characters).
43 Internal I/O, record too long.
44 TL, record too long.
45 zero field length in I, L, F, E, G, D format
1000+n MS-DOS Error n
1002 File not found
1003 Path not found
1004 Too many open files
1005 Access denied
1008 Not enough free RAM
1012 Invalid access code
1015 Invalid disk drive
[Next]
[Previous]
[Fortran Tutorial Home]