- 积分
- 38420
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-6-20
- 最后登录
- 1970-1-1
成长值: 0
|
发表于 2011-12-5 16:13:30
|
显示全部楼层
看,write(x,y),前一个是表示打开的unit,如果同时打开多个unit的话,在不同的里面输出,比如:
open(1,file="hello.txt")
open(2,file="fine.txt")
write(1,*) "this is file 'hello' "
write(2,*) "this id file 'fine' "
close(1)
close(2)
那么文件hello.txt里面写的是this is file 'hello' ;fine.txt里面写的是this id file 'fine'
注意,close部分是可以缺省的,但是最好写上,因为如果你一下子打开两个unit 1,如下
open(1,file="hello.txt")
write(1,*) "this is file 'hello' "
close(1)
open(1,file="fine.txt")
write(1,*) "this id file 'fine' "
close(1)
此处第一个close(1)不可缺省哦
关于print,我曾经想试试看能不能想write写入到一个open file里面,但是没有成功,当然像清风那个,设置一下输出的格式是ok的
 |
|