- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
haw to call a function without an assigning a returning value?
following code works at Compaq:
program TestProgram
call testFunction()
contains
integer function testFunction()
testFunction = 13
end function testFunction
end program TestProgram
but Intel compiller returns the error:
Test.F90(4): Error: The CALL statement is invoking a function subprogram as a subroutine. [TESTFUNCTION]
following code works at Compaq:
program TestProgram
call testFunction()
contains
integer function testFunction()
testFunction = 13
end function testFunction
end program TestProgram
but Intel compiller returns the error:
Test.F90(4): Error: The CALL statement is invoking a function subprogram as a subroutine. [TESTFUNCTION]
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You fix the error in your code and reference it as a function. The cases where it was "safe" to CALL a function were too few so we simply disallowed this. Assign the value to a throwaway variable.

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