View previous topic :: View next topic |
Author |
Message |
Abhishek
Joined: 22 Dec 2010 Posts: 28
|
Posted: Fri Jan 14, 2011 11:55 am Post subject: I/O error |
|
|
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 |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Fri Jan 14, 2011 4:31 pm Post subject: |
|
|
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. |
|
Back to top |
|
 |
Abhishek
Joined: 22 Dec 2010 Posts: 28
|
Posted: Fri Jan 14, 2011 5:05 pm Post subject: |
|
|
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. |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Sat Jan 15, 2011 9:44 am Post subject: |
|
|
INPIN(RPTR:) is a substring of a character variable with many characters
but INPIN looks like an array of characters of length one. |
|
Back to top |
|
 |
Abhishek
Joined: 22 Dec 2010 Posts: 28
|
Posted: Sat Jan 15, 2011 2:28 pm Post subject: |
|
|
I am using INPIN as follows:
SUBROUTINE INPC(INPIN)
CHARACTER(*) INPIN
When calling INPC from VB, a string variable is passed. |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Sat Jan 15, 2011 5:04 pm Post subject: |
|
|
If you can post a complete small working program showing this error then I will take a look at it. |
|
Back to top |
|
 |
|