IARGC when using IMPLICIT NONE

John Spray <[email protected]> Tue, 11 May 2004 07:32:53 +0100
Newsgroups gmane.comp.compilers.g95
Message-ID <[email protected]>
Hi,

I'm new to g95, and I'm having some confusion with the behaviour of the 
intrinsic function iargc.  Please forgive me if I'm missing something 
obvious, since I'm by no means a F90 expert.

1.
"""
program foo
         print *, iargc()
end program foo
"""
Works fine.

2.
"""
program foo
         IMPLICIT NONE
         print *, iargc()
end program foo
"""

Says "Error: Function 'iargc' at (1) has no implicit type"

This confuses me: I can use the intrinsics for cos and sin without 
declaring them, even when I use IMPLICIT NONE.  How is iargc different 
in this respect?

3.
"""
program foo
         IMPLICIT NONE
         INTEGER,INTRINSIC :: iargc
         print *, iargc()
end program foo
"""

Says
"""
INTEGER,INTRINSIC :: iargc
                           1
Error: Intrinsic at (1) does not exist
"""

What would be the correct way to declare this?

Thanks,
John Spray
([email protected])


-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver
higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3