Silverfrost Forums

Welcome to our forums

I/O error

14 Jan 2011 10:55 #7488

I am using FTN95 to build a dll and calling from a VB .NET dll.

Whenever there is an error inside FORTRAN code, and the next time FORTRAN function is called, it shows up an error like:

a function called from within an i/o statement has itself performed i/o

The error occurs when the first internal read function is encountered.

The first error inside FORTRAN code is caught by a .NET try..catch block.

Thanks Abhishek

14 Jan 2011 3:31 #7494

This may be a spurious error message but when the error message is correct it means that the I/O is being called recursively. In other words your I/O list contains a function/subroutine call that in turn uses I/O. You cannot do this with FTN95.

14 Jan 2011 4:05 #7497

the error is caused at following statement:

READ(INPIN(RPTR:),10) IDEN

INPIN is CHAR(3000) RPTR is integer = 1 IDEN is CHAR(80) 10 is a label FORMAT(80A1)

The content of INPIN remains same. Sometimes this error message is caused and sometimes not.

15 Jan 2011 8:44 #7500

INPIN(RPTR:) is a substring of a character variable with many characters but INPIN looks like an array of characters of length one.

15 Jan 2011 1:28 #7501

I am using INPIN as follows:

SUBROUTINE INPC(INPIN)

CHARACTER(*) INPIN

When calling INPC from VB, a string variable is passed.

15 Jan 2011 4:04 #7505

If you can post a complete small working program showing this error then I will take a look at it.

Please login to reply.