Well it looks like only integer variables are allowed in DATA statements. I guess maybe what I had was an extension to the F77 standard? Oh well I can work around it. An it's probably time to let this topic expire. Thanks very much for the help offered here! [smile]
Nope. Distilled to simple program:
PROGRAM FOO
CHARACTER*1 ESCAPE
DATA ESCAPE/Z'1B'/
END
Compile with:
gfortran -c -g -S -ffixed-line-length-none -fno-align-commons -fallow-invalid-boz -std=legacy
Still get:
Error: BOZ literal constant cannot be assigned to a 'CHARACTER(1)' variable
Nope. Rename didn't help. I found that the error is due to the data assignment, not the ! comment.
CHARACTER*1 ULA, URA, DLA, DRA, ESCAPE
DATA ESCAPE/Z'1B'/
The above is supposed to assign the hex value for Escape which is 1B (or 33 octal or 27 decimal) to the variable ESCAPE.
Instead I get...
Sorry - COMPASS.IN contains:
CHARACTER*1 UP, DOWN, LLEFT, RRIGHT
CHARACTER*1 ULA, URA, DLA, DRA, ESCAPE
DATA ESCAPE/Z'1B'/
DATA UP/Z'17'/
DATA DOWN/Z'1A'/
DATA LLEFT/Z'19'/
DATA RRIGHT/Z'18'/
DATA ULA/Z'5C'/ ! Up left angle
DATA URA/Z'5D'/ ! Up right angle
DATA DLA/Z'5E'/ ! Down...
I'm using .for for a source file extension.
The error message I get is:
COMPASS.IN:12:20:
12 | DATA DRA/Z'5F'/ ! Down right angle
| 1
Error: BOZ literal constant near (1) cannot be assigned to a 'CHARACTER(1)' variable...
My old F77 source has comments on individual lines like:
DELIM = DELIM_LIST(K) ! Get delimiter
Not possible with gfortran? No big deal but if there is another magic switch, yay!
Hey that worked! Thanks. That business with 2 kinda rings a bell with me. Standard out & standard error? Used to manage a bunch of Unix servers back in the 90's. Been a long time. I made a batch file (macro) to compile in DOS.
echo off
gfortran -c -S -ffixed-line-length-none -std=legacy %1 2> %1.err
Thanks mikrom et al. The -c switch does the trick. I looked all over for that kind of info but no luck. I ask here when I hit a wall. I bet there are other switches like error output redirect. Can you point me to a document that covers this? I just found a man page for gfortran but I don't see...
Thanks all for the info. I installed the gfortran compiler and am using it via command line. I'm getting strange errors using gfortran -std=legacy. It looks like the compiler is building an exe by default and wants all subroutines specified. That means all modules must be specified on the...
Hi I'm new here and hope this isn't a question beaten to death. I'm thinking about getting back into Fortran and would like to find a compiler that works on Windows 64 bit. By compiler, I mean something that compiles the source, generates binaries and then an executable. I would prefer something...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.