- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I get this "recursive I/O operation" breakpoint.
Are there ANY rules that prevent me from priniting out the function value as an intermediate result?
It runs OK if I comment out the second print statement near the end.
It might be related to having that array in COMMON rather thanhaving it as input argument.
Why does it say "UNIT -1" - - does that even exist?
That why it seems peculiar, anyway.
************************************************************************************
program test4
integer*1 p(10)/10*10/
integer*8 prod,prod1
common/com1/p
print *,"prod=",prod()
read(*,*)
end program
integer*8 function prod()
common/com1/p
integer*1 p(10)
prod=1
do i=1,10
prod=prod*p(i)
print *,"i=",i," prod=",prod
end do
end
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How would I modify this so that I can print out an intermediate result (for debugging) anyway.
BTW, is there a way to make the forum letters a little larger?
I don't see an option for that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
print *,"prod=",prod()
do
prod1 = prod()
print *, "prod=",prod1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you are using IE to access the forum then from the menu View->Text Size-> you have a choice from Largest to SmallestBTW, is there a way to make the forum letters a little larger?
I don't see an option for that.
Les
Ignore that I've just tried it and it made no difference. Strange.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
zoom is good for senior eyes like mine.
Thanx for suggestion ! ! !
Actually, another answer rather than WRITE(6,*) is to put the function value
in a temporary variable, then print that out instead.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page