This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: open statement


r. radna wrote:

>     I have a persistent problem with the OPEN statement.
> as in
> 
> OPEN(UNIT=JDISK,NAME=NAMEIN,STATUS='OLD')
>                      ^ INCOMPATIBLE TYPE VARIABLE
> 
> NAMEIN is a vector of character type; a variable which I read
> into a file iteratively.

From the source you included it's clear that (as you say) NAMEIN is an
array of characters.  Unfortunately, that's not what OPEN expects:  It
needs a CHARACTER *variable*, i.e. one string that's declared something
like:

      CHARACTER*20 NAMEIN
      DATA NAMEIN /'thefilename'/

Hope this helps,

-- 
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
GNU Fortran 95: http://g95.sourceforge.net/ (under construction)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]