如何在 OpenVMS Fortran 中获取命令行参数?
How to get command line arguments in OpenVMS Fortran?
我需要在 Fortran 90 标准中实现 c 代码并在下一个问题上停止。如何获取和使用命令行参数。我发现
GET_COMMAND_ARGUMENT
getarg
但是在openvms系统中用fortran 90编译器就不行了。
还有另一种在 Fortran 中获取命令行参数的方法吗?
C 中的示例
int main(int argc, char **argv)
{
if (argc > 1)
....
}
示例(不起作用“
ILINK-W-NUDFSYMS, 2 undefined symbols:
%ILINK-I-UDFSYM, GETARG
%ILINK-I-UDFSYM, IARGC
%ILINK-W-USEUNDEF, undefined symbol
IARGC referenced
)
PROGRAM bulk1
INTEGER :: i
CHARACTER(len=32) :: arg
DO i = 1, iargc()
CALL getarg(i, arg)
WRITE (*,*) arg
END DO
END PROGRAM
"How do I access the program command line?" is likely to feature high on any Fortran related FAQ. Unfortunately, the equally frequent answer is "It depends". Up to and including Fortran 95, there has been no standard method of command-line access. While the F2003 standard finally addresses this requirement, it is reasonable to assume that F2003 compilers will not be in general usage for some time. In the meantime, this leaves the Fortran community with its existing hotchpotch of inconsistent solutions for several years to come.
如果您拥有这两种编译器的许可证,您可能想要创建一个 C 主程序,调用 Fortran 服务函数。
获取命令行的相对简单的方法是调用 OpenVMS 特定函数 LIB$GET_FOREIGN
,尽管无需进一步解析为 'words'
查看:http://computer-programming-forum.com/49-fortran/e047637fc421ace6.htm
祝你好运。
海因.
我需要在 Fortran 90 标准中实现 c 代码并在下一个问题上停止。如何获取和使用命令行参数。我发现
GET_COMMAND_ARGUMENT
getarg
但是在openvms系统中用fortran 90编译器就不行了。 还有另一种在 Fortran 中获取命令行参数的方法吗?
C 中的示例
int main(int argc, char **argv)
{
if (argc > 1)
....
}
示例(不起作用“
ILINK-W-NUDFSYMS, 2 undefined symbols:
%ILINK-I-UDFSYM, GETARG
%ILINK-I-UDFSYM, IARGC
%ILINK-W-USEUNDEF, undefined symbol IARGC referenced )
PROGRAM bulk1
INTEGER :: i
CHARACTER(len=32) :: arg
DO i = 1, iargc()
CALL getarg(i, arg)
WRITE (*,*) arg
END DO
END PROGRAM
"How do I access the program command line?" is likely to feature high on any Fortran related FAQ. Unfortunately, the equally frequent answer is "It depends". Up to and including Fortran 95, there has been no standard method of command-line access. While the F2003 standard finally addresses this requirement, it is reasonable to assume that F2003 compilers will not be in general usage for some time. In the meantime, this leaves the Fortran community with its existing hotchpotch of inconsistent solutions for several years to come.
如果您拥有这两种编译器的许可证,您可能想要创建一个 C 主程序,调用 Fortran 服务函数。
获取命令行的相对简单的方法是调用 OpenVMS 特定函数 LIB$GET_FOREIGN
,尽管无需进一步解析为 'words'查看:http://computer-programming-forum.com/49-fortran/e047637fc421ace6.htm
祝你好运。 海因.