- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a theory question: It's possible to pass a global variale (from a module) to a subroutine in x64 program?
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I fail to see the relevance of "x64 program". According to the Bible Fortran Standard, you are allowed do it, and that supposedly has nothing to do with the compiler or architecture.
The only constraint is that the subroutine may not simultaneously refer to both the dumy argument and the said global variable in a non-read-only fashion. For example, this is a no-no in general:
The only constraint is that the subroutine may not simultaneously refer to both the dumy argument and the said global variable in a non-read-only fashion. For example, this is a no-no in general:
MODULE Mod
INTEGER I
END MODULE Mod
PROGRAM
Use Mod
CALL FOO(I)
PRINT *, I
END PROGRAM
SUBROUTINE FOO(J)
Use Mod, ONLY: I
J = J + I
I = J * I
PRINT *, J, I
END SUBROUTINE
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page