如何只获取所有函数和过程名称,而不是自己编写解析器?
以下面的vbs代码为例,包括1个函数、1个过程、2个语句,我想得到函数和过程名称: 1)"GetValue“2) "ABC_Result”
尽管微软提供的IScriptControl::AddCode可以工作,但谁的问题是总是执行语句(如"ABC_Result 20",“而真实的Wend")默认?
//\test.vbs
Function GetValue(varVal)
GetValue = varval*2
End Function
Sub ABC_Result(count)
'msgbox is not allowed in server side, so use beep
Dim WshShell
Set WshShell = CreateObject("Wscript.Shell")
beep = chr(007)
Dim i
For i=0 To CInt(count)
WshShell.Run "cmd /c @echo " & beep, 0
Next
End Sub
ABC_Result 20
While True
Wend发布于 2013-03-20 05:53:48
编写“解析器”可能是一种方式,可以使用像Instr()这样的字符串函数,甚至是正则表达式。
然而,有一些第三方工具,如http://www.sourceformat.com/vbscript-formatter.htm,可能会给您提供交叉参考列表。
https://stackoverflow.com/questions/13007326
复制相似问题