看板Programming
标 题Re: [问题] Fortran程式 数字与文字转换的问题
发信站KKCITY (Tue Sep 2 17:34:44 2008)
转信站ptt!ctu-reader!ctu-gate!news.nctu!news.ntu!news.au!zoonews.ee.ntu!news
※ 引述《[email protected] (霹雳牛)》之铭言:
> 我想要作的事情,就是把FilePath中的055变成变数,也就是说我想这麽作:
> MyNumber=055
> FilePath='files\MyNumber.txt'
> 但要使此处FilePath能够输出为'files\055.txt',
> 也就是将55变成变数,使我能让它进回圈,
> 让输出的档名能够是001.txt、002.txt等,请问我该怎麽写?
把FilePath当作一个output descriptor,用write写进去
write (FilePath, '("files\\", I3.3, ".txt")') 99
执行结果就是
files\099.txt
--
蒙帝派松正体中文计画 (4/23)
- 如何隐身 - SPAM - 英国杀人笑话
http://www.wretch.cc/blog/journeyman&article_id=14377810
▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂
■法外科学暨工程顾问公司■ http://www.wretch.cc/blog/journeyman/
▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆
--
┌─────◆KKCITY◆─────┐ ◆NOKIA 3G手机上网搭配中华电信门号◆
│ bbs.kkcity.com.tw │ ★ http://www.kkbox.com.tw ★
└──《From:59.115.204.232
》──┘ 唱片公司授权百万歌曲 $99/月 随身聆听
--
1F:推 heysunday:非常谢谢你^^140.116.161.129 09/02 19:11