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

 

 

附件尺寸
下载 example-source1.f901.03 KB
2 帖子 / 0 全新
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项

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

发表评论

登录添加评论。还不是成员?立即加入