Error passing text-string in a subroutine call

Error passing text-string in a subroutine call

Hi,

When compiling the code below I get the message:

Error 1  Error: If the actual argument is scalar, the corresponding dummy argument shall be scalar unless the actual argument is an element of an array that is not an assumed-shape or pointer array, or a substring of such an element.   [TEXT] C:\CALC\veivaks\Veivaks2_IVF\Veivaks2_IVF\Example_Source1.F90 14 
Error 2  Error: If the actual argument is scalar, the corresponding dummy argument shall be scalar unless the actual argument is an element of an array that is not an assumed-shape or pointer array, or a substring of such an element.   [TEXT] C:\CALC\veivaks\Veivaks2_IVF\Veivaks2_IVF\Example_Source1.F90 17 

This sibroutine and call has been used for VAX/VMS, MS Powerstation and with CVF without problems, but with IVF it do not work. What's wrong:

The example code is attached

Regards

 

 

AnhangGröße
Herunterladen example-source1.f901.03 KB
2 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.
Bild des Benutzers gvautier

Hello

Old compilers doesn't detect such usage : treating as character*1 array a character*n argument.

Replace

CHARACTER*1 TEXT(50),IEND,TEX(50)

by

CHARACTER*(*) TEXT

CHARACTER*1 IEND,TEX(LEN(TEXT))

and

TEXT(I)

by

TEXT(I:I)

I think it will works

Melden Sie sich an, um einen Kommentar zu hinterlassen.