|
9#

楼主 |
发表于 2014-6-26 13:35:06
|
只看该作者
那你岂不是很辛苦,哈哈。还有一个问题。
[Fortran] 纯文本查看 复制代码 01 | subroutine intoch ( cvar , ivar , ilend ) |
02 | c * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
04 | c * PURPOSE : Write integer left - justified into character variable * |
06 | c * ARGUMENTS : CVAR - character variable receiving integer * |
07 | c * IVAR - integer to write into character * |
10 | c * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
15 | c - - Local working storage |
18 | c - - - - Find required length to write IVAR , including sign |
23 | if ( ivara .lt. mag ) go to 200 |
26 | 200 if ( ivar .lt. 0 ) ilen = ilen + 1 |
27 | c - - - - Write IVAR into CVAR , left justified. If CVAR length is not |
28 | c enough , FORTRAN error handling is used ( '*****' ) |
29 | ilen = min ( ilen , len ( cvar ) ) |
30 | write ( cform , '(a,i2,a)' ) '(I' , ilen , ')' |
32 | write ( cvar , cform ) ivar |
倒数第三行,为什么cform也写到了格式的位置,难道是按照cform的格式表示ivar,然后将值赋给cvar? |
|