- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
character*(FileNameLength) cFileName
- Etiquetas:
- Intel® Fortran Compiler
Enlace copiado
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Perhaps you are including several header files some of which may declare the same common block but with different/different allocations of variables?
Also your given declaration for cFileName is not in a COMMON.
Jim Dempsey
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
The problem is that I have FileNameLength defined in a common block AND in the program.
The program has
include 'fnames.gcb'
integer,parameter:: FileNameLength=250
character*(FileNameLength) cFileName
etc...
The common block is in file 'Fnames.gcb'
integer,parameter:: FileNameLength=250
character*(FileNameLength) cgbf,CCOD
common/fnames/ cgbf,CCOD
The error message is:
This name has already been assigned a data type. [FILENAMELENGTH]
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
FileNameLength isn't a variable - you have declared it as a PARAMETER value and are attempting to assign a value to it twice.
Also make sure you aren't mixing up 250 and 255 for your name lengths
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
I want to use the variable 'FileNameLength' in several Common blocks.
I have tried removing them, to leave only one, but get the error messages:
'A COMMON block data object must not be an automatic object.'
and
'This name has not been given an explicit type. [FILENAMELENGTH]'
I'm getting confused,
David
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Jugoslav
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
I'm not sure if I follow you.
I have made a new common block called fnl.gcb:
integer:: FileNameLength=250
common/FNL/FileNameLength
It wouldn't compile with 'Parameter'.
Then in each program that needs this variable or has an include file that needs this variable I have added include 'fnl.gcb'.
When I compile, I get an error on the first program which containsa common block.
Error: A COMMON block data object must not be an automatic object.
I don't know what that error messagemeans.
I don't think I have any spelling problems.
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Your original problem was that you defined FileNameLength twice, once in .gcb file and other time again in code (.for file) (that's what I meant by "spelled"). The solution was just to remove the re-declarations.
Jugoslav
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
David,
If you can, why not dispense with COMMON. You can do this by creating a module containing the arrays, variables and constant parameters. I've done this on a Solution with 11 project files and ~700 source modules. It is a bit of work but you can do it incrimentaly. You could start with
-----------------------------
character*(FileNameLength) cFileName
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
! file name length
integer,parameter:: FileNameLength=250
end module
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
oops us
#define Array bing.Array
#define Array1 bing.Array1
- Suscribirse a un feed RSS
- Marcar tema como nuevo
- Marcar tema como leído
- Flotar este Tema para el usuario actual
- Favorito
- Suscribir
- Página de impresión sencilla