24小时热门版块排行榜    

CyRhmU.jpeg
查看: 630  |  回复: 3

mansamsung8113

木虫 (正式写手)

[求助] 关于fortran new_line函数的用法已有2人参与

请问fortran 中new_line()函数的具体含义和用法是什么?
回复此楼
坚持不懈
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

fxj126

木虫 (小有名气)

【答案】应助回帖

感谢参与,应助指数 +1
这是GNU上的官方说明,供参考。
Description:
NEW_LINE(C) returns the new-line character.

Standard:
Fortran 2003 and later

Class:
Inquiry function

Syntax:
RESULT = NEW_LINE(C)

Arguments:
C  The argument shall be a scalar or array of the type CHARACTER.




Return value:
Returns a CHARACTER scalar of length one with the new-line character of the same kind as parameter C.

Example:
          program newline
            implicit none
            write(*,'(A)') 'This is record 1.'//NEW_LINE('A')//'This is record 2.'
          end program newline
2楼2015-07-17 15:43:03
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

mansamsung8113

木虫 (正式写手)

引用回帖:
2楼: Originally posted by fxj126 at 2015-07-17 15:43:03
这是GNU上的官方说明,供参考。
Description:
NEW_LINE(C) returns the new-line character.

Standard:
Fortran 2003 and later

Class:
Inquiry function

Syntax:
RESULT = NEW_LINE(C)

Argum ...

谢谢 您的回答,请问倒数第二行代码: write(*,'(A)') 'This is record 1.'//NEW_LINE('A')//'This is record 2.'中的在NEW_LINE('A')两边的//是什么意思?
坚持不懈
3楼2015-07-18 14:44:51
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

charleslian

木虫 (小有名气)

【答案】应助回帖

★ ★ ★ ★ ★
感谢参与,应助指数 +1
mansamsung8113: 金币+5, ★★★★★最佳答案 2015-07-19 12:02:48
引用回帖:
3楼: Originally posted by mansamsung8113 at 2015-07-18 14:44:51
谢谢 您的回答,请问倒数第二行代码: write(*,'(A)') 'This is record 1.'//NEW_LINE('A')//'This is record 2.'中的在NEW_LINE('A')两边的//是什么意思?...

字符串链接算符,将两个字符串链接成一个字符串

[ 发自小木虫客户端 ]
4楼2015-07-18 15:01:07
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 mansamsung8113 的主题更新
信息提示
请填处理意见