• Please review our updated Terms and Rules here

Bc fortran

Jtterbug

Experienced Member
Joined
Sep 13, 2010
Messages
158
Location
Pacific NW
Hello

I keep getting an error when I enter the following in BC FORTRAN;

1 WRITE (*,*) "HELLO WORLD"
2 STOP
3 END

I get random characters like smilyfaces and hearts with "HELLO WORLD" stuck somewhere in there. What am I doing wrong?
 
Well, now it prints "Smileyface *SPACE* arrow, diamond, female symbol."

Do I number the lines or not? I am using the tabulate key, do I need to do 5 seperate spaces?
 
You need not number the lines. Normally, in FORTRAN, only those lines needing a number (because they're referenced by another statement) are numbered.

My program simply prefixed the first non-blank character on each line with a TAB (09 ) character, so, in hex the entire file looks like this:

Code:
 09 57 52 49 54 45 28 2A 2C 2A 29 20 27 48 65 6C
 6C 6F 20 57 6F 72 6C 64 27 0D 0A 09 53 54 4F 50
 0D 0A 09 45 4E 44 0D 0A
For what it's worth, I've got BCF compiler 1.3b1711. I'm running under a command window in XP, all the files are in the same directory, and my commands are:
Code:
BCRTSY                          (to load the resident)
BCF TEST                        (compile)
BCL TEST LIB                    (link)
TEST                            (run)
 
Well, I tried removing the numbers, still the same. I tried running it through the linker, nothing. Could the compiler be corrupted?
 
I got it off the net (I'll need to find the site)
IBM Personal Computer DOS Version 3.30 running on an IBM 5150 with 640 K memory and a HDD.
I transfered the file by dialup.

I have a MSDOS 5 disk(I think) if that would be better.
 
Have you tried to download any of their Fortran code? It is possible that your specific compiler download got corrupted. Known good code intended to be targeted at that compiler makes for a simple test.

Use spaces at the beginning of each line to pad everything out correctly. Some compilers went flakey when faced with tabs.

Does the compiler have to be DOS based for what you are doing? I liked the old MS Fortran from the late 80s which ran on DOS and was okay for smaller programs. OpenWatcom (based on the very old Watcom products) does have a DOS version still available though I haven't used it. Watfor77 (80s DOS release) was good and the Windows implementation of OpenWatcom's Fortran compiler seems like a nice product. http://www.openwatcom.org/index.php/Download Or maybe not what with a 66MB download; I am confused.
 
Last edited:
Kreb, I just ran the same compiler that the OP did. Tabs work just fine.

Here's where I got it.

Could be corrupted or downlevel.

WATFOR77 is a nice dialect for DOS that's small (total download: ~150KB), but it seems to have disappeared from the web. Maybe a forum member has a copy.

Microsoft also used to have some very nice FORTRAN 77 compilers for DOS. I think they show up occasionally.
 
Well, I tried removing the numbers, still the same. I tried running it through the linker, nothing. Could the compiler be corrupted?
Did you observe the following statment from the file "ENGLISH.TXT" that comes with the compiler in the same ZIP-archive?

ENGLISH.TXT said:
BEFORE the compiler, linker or program is started, the resident run-time
system MUST be loaded
. For this, just run the program BCRTSY.EXE. If you use
BC-FORTRAN77 regularly, place BCRTSY.EXE in your AUTOEXEC.BAT file.
 
Back
Top