Fortran graphics

Barbara Vaughan BVAUGHAN at pucc.Princeton.EDU
Wed Feb 8 02:26:33 AEST 1989


In article <4328 at hubcap.UUCP>, rajohn at hubcap.UUCP (r alan johnson) writes:

>This may be a stupid question, but since the Microsoft FORTRAN 4.1
>compiler tells me that it is possible to link Microsoft C object files,
>is it just as possible to link Turbo C 1.5 object files? ...An object
>file is an object file, isn't it?
>
No, unfortunately not.  You can't even link together two Fortran routines
compiled with different compilers.  In the cases, such as you mention,
where routines from one language can be combined with those from
another, compatiblity of instructions, word length, I/O handling, and
many other things that normally wouldn't be compatible has been estab-
lished. Even then, one must proceed with great caution.  A quote from
my Lahey Fortran F77L manual, advising programmers who wish to link
Lahey Fortran routines with Lattice C routines, will give you an idea
of the complications: "Since Fortran stores multidimensional arrays
in column-major order, while C stores arrays in row-major order, it
is usually not convenient to pass multidimensional arrays... (if you
do)...an n-dimensional array A that is declared: A(i1,i2,...in) ...
must be accessed with subcripts reversed in C...: A(in,in-1...i1).
Also, the first element of a C array dimension is 0, so Fortran
arrays should be dimensioned (0:n-1) for an array of size n. "
   I have been looking for a library of Fortran-callable graphics
routines (see my previous posting) and so far have heard of one,
although I haven't seen it yet. It is called NO LIMIT by M.E.F
Environmental, Limited of Austin, Texas. It provides "graphics,
screen control, communications, character/string manipulation,", etc.
The graphics it supports include the basic DRAW functions, GET, PUT,
PAINT, ROTATE and various others. Microsoft is one of the four
Fortran compilers they claim compatibility with.
For those who are primarily interested in text screen control
(scrolling, windows, etc.) along with cursor control and keyboard
control, the Spindrift Library from Spindrift Laboratories, Arling-
ton Heights, IL is quite useful. It is available for F77L (Lahey)
and Microsoft Fortran. I have used it to create user-interface
menus in my Fortran programs.

Barbara Vaughan



More information about the Comp.lang.c mailing list