Re: [R] passing char to Fortran routine

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Tue 11 Oct 2005 - 01:35:12 EST

> PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html

Programming questions are appropriate for R-devel, as it says there.

The issue is OS-specific, but we don't see what your Fortran code is. If you send a reproducible example to the R-devel list, people may be able to suggest what the problem is.

On Mon, 10 Oct 2005, Ingmar Visser wrote:

> Hello all,
>
> I am using an existing Fortran routine that takes a single character string
> as argument. The routine echoes the argument that I provide. When working on
> OS X 3.9 there seems to be no problem, ie the Fortran routine nicely echoes
> my argument. However, I compiled the same package on a PC (using all the
> tools provided in the R for windows faq), and the routine only echoes the
> first letter of each character string that I pass on to it.
>
> My questions are:
> 1) Is this somehow compiler specific?
> 2) Should I explicitly provide the Fortran routine with the length of the
> character string?
> 3) I am at a loss as to what is happening here, so any hint is welcome (-;
>
> The call to the Fortran routine is as follows:
>
> .Fortran("npoptn",as.character(opt),PACKAGE="depmix")
>
> where opt is a character string such as opt="Iteration limit = 100"

-- 
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 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Tue Oct 11 01:48:18 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 18:37:46 EST