FORTRAN中读入的数据文件DAT,对一些变量批量赋初值, 如何在数据文件中,加注释让别人知道这些数据的意义

FORTRAN中读入的数据文件DAT,对一些变量批量赋初值, 如何在数据文件中,加注释让别人知道这些数据的意义,第1张

如果数据少的话可以用namelist,支持以!开头的注释行。否则只能是把格式固定下来,比如说每行10个变量,在程序里就设定每个read语句读10个,这样每行后面就可以任意加入说明文字

做法:(1) 在..\Microsoft Visual Studio\Common\MSDEV98\MACROS文件夹下生成文件GrpComment.dsm(2) 用文本编辑器打开该文件,将以下所附的代码贴在其中,保存(注意保留.dsm后缀)(3) 启动CVF,选Tools=>Customize=>Add-ins and Macro Files(4) 在GrpComment前打勾,去掉其他的勾(5) 在同一对话框中选Commands=>Macros,此时在右边可以看见CommentDel和CommentOut(6) 选中CommentOut,拖到CVF的工具栏上去(添加工具钮),会d出Button Appearance对话框(7) 选Image and text,在下边Button text框中输入名称(默认是CommentOut),如“加注释”(8) 类似的方法再将CommentDel命令以工具钮的形式添加到工具栏上,名称可取为“去注释”这时,工具栏上应该多了两个工具钮:“加注释”和“去注释”。用法:加注释:选择要加注释的多行代码,点击“加注释”按钮即可;去注释:选择已经注释的多行代码,点击“去注释”按钮即可。适用:后缀为f90或f77的代码文件。Enjoy!!!VBscript代码:Function FileType (ByVal doc) ext = doc.Name FileType = 0 pos = Instr(ext, ".") if pos >0 then Do While pos 1 ext = Mid(ext, pos, Len(ext) - pos + 1) pos = Instr(ext, ".") Loop ext = LCase(ext) end if If ext = ".f90" Then FileType = 8 ElseIf ext = ".for" Then FileType = 9 Else FileType = 0 End If End FunctionSub CommentOut ()'DESCRIPTION: 为所选的多行代码加注释 Dim win set win = ActiveWindow if win.type "Text" Then MsgBox "This macro can only be run when a text editor window is active." else TypeOfFile = FileType(ActiveDocument) If TypeOfFile = 8 Or TypeOfFile = 9 Then If TypeOfFile = 8 Then CommentType = "! " ' Fortran 90 file Else CommentType = "C " ' Fortran 77 file End If StartLine = ActiveDocument.Selection.TopLine EndLine = ActiveDocument.Selection.BottomLine If EndLine <StartLine Then Temp = StartLine StartLine = EndLine EndLine = Temp End If If EndLine = StartLine Then ActiveDocument.Selection.SelectLine ActiveDocument.Selection = CommentType + ActiveDocument.Selection Else For i = StartLine To EndLine ActiveDocument.Selection.GoToLine i ActiveDocument.Selection.SelectLine ActiveDocument.Selection = CommentType + _ ActiveDocument.Selection Next End If else MsgBox("Unable to comment out the highlighted text" + vbLf + _ "because the file type was unrecognized." + vbLf + _ "If the file has not yet been saved, " + vbLf + _ "please save it and try again.") End If End IfEnd SubSub CommentDel ()'DESCRIPTION: 去除所选的多行代码的注释 Dim win set win = ActiveWindow if win.type "Text" Then MsgBox "This macro can only be run when a text editor window is active." else TypeOfFile = FileType(ActiveDocument) If TypeOfFile = 8 Or TypeOfFile = 9 Then StartLine = ActiveDocument.Selection.TopLine EndLine = ActiveDocument.Selection.BottomLine If EndLine <StartLine Then Temp = StartLine StartLine = EndLine EndLine = Temp End If If EndLine = StartLine Then ActiveDocument.Selection.SelectLine ActiveDocument.Selection = mid(ActiveDocument.Selection, 3) Else For i = StartLine To EndLine ActiveDocument.Selection.GoToLine i ActiveDocument.Selection.SelectLine ActiveDocument.Selection = mid(ActiveDocument.Selection, 3) Next End If else MsgBox("Unable to comment out the highlighted text" + vbLf + _ "because the file type was unrecognized." + vbLf + _ "If the file has not yet been saved, " + vbLf + _ "please save it and try again.") End If End IfEnd Sub

fortran的注释方式,除了行首加“!”外,还有什么?

在自由格式中,只有!一种方法

在固定格式中,除了!还可以用c或C,但必须写在前五个字母,即绿线的左边。

除了液压还有什么加压方式

液压,气压,机械螺旋,水压等

除了QQ还有什么方式聊天

MSN

Google Talk(不能申请,只能人家邀请使用.是目前最好,体积最小(小于1M)的聊天工具了,但中国人不怎么用...)

Skype

网易POPO

淘宝旺旺

Yahoo Messager

新浪 UC

盛大圈圈

以上是国内主流即时聊天工具另外,杂牌聊天工具在这找

:sky./sort/sort2040100_indate_DESC_1.

除了PVC热缩帽外还有什么封口方式

PVC热缩套有很多尺寸,最好的几毫米都有,让你的供应商做更小的帽,不行就到某宝去买。

或者用锡箔片封口,也是一种常用的方式。

除了jsonp还有什么跨域的方式

XHR2:

1、HTML5提供的XMLHttpRequest Level2已经实现了跨域访问以及其他的一些新功能

2.IE10以下的版本都不支援

3.在伺服器端

header('Aess-Control-Allow-Origin:*')

header('Aess-Control-Allow-Methods:POST,GET')

假的蜂蜜除了会加水之外还有什么方式?

假的蜂蜜除了会加水之外还有加糖精的。

*** 的方式除了九六还有什么方式

只要能够插的进去,两个人都愿意接受的方式都可以的,尽情发挥自己的想象就行,只有想不到没有做不到!

火箭除了串联还有什么方式

混联:靠近地面的是第一级,几个火箭并联,再与上面的第2级串联,可能还有火箭头那块进行串联。具体情况还是建议你百度一下。

除了看书还有什么消遣方式?

多了 比如泡妞啊,泡网咖啊,泡厕所啊,逛街啊,KTV啊,打游戏啊......别说是我教的啊,其实看书是最健康实惠的消遣方式了。

php中除了get和post还有什么方式

PHP中最常见的就是get和post方法,如果你的引数可见,使用get,如果你的引数需要不可见,就使用post,还有一种方法是any,即get和post都可以提交,但是不建议使用这种方法,因为要考虑提交引数的安全问题,在laravel框架中,路由定义中也有any的用法


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/bake/11939077.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-19
下一篇 2023-05-19

发表评论

登录后才能评论

评论列表(0条)

保存