From Prof Brian Ripley <ripley@stats.ox.ac.uk>  Mon Sep  6 13:54:37 1999
From: Prof Brian Ripley <ripley@stats.ox.ac.uk> (Prof Brian Ripley)
Date: Mon, 6 Sep 1999 13:54:37 +0100 (BST)
Subject: Fortran character strings
Message-ID: <199909061254.NAA00597@toucan.stats.ox.ac.uk>

Has anyone ever successfully used Fortran character strings with R?

?Foreign says

         R              C                  Fortran
      integer       int *              integer
  ....
      character     char **            [compiler dependent]

     Character strings are passed as C arrays of character
     strings to Fortran: the first string may be usable if
     its length is passed separately.

and I have been taking a look. The linkage sends char ** to Fortran.
On the other hand, INTPR and  DBLEPR assume Fortran character strings
are char *.  On all my systems DBLEPR works and .Fortran does not,
but I do know of one compiler (Watcom Fortran for Windows NT) where the 
linkage really is equivalent to char **.

Fortran in S takes the first string in a character vector and passes that as
char * (except on the Watcom-compiled Windows version), as far as I
can deduce without the source code.

I think we should either ban character strings in .Fortran or follow
the S prototype unless someone has a way around this.  With different
compilers on the same platform having different conventions whatever we
do (except a ban) will be compiler-dependent.

Any suggestions?

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


Fortran character strings
Prof Brian Ripley