自分でパーサーを書く代わりに、すべての関数とプロシージャの名前だけを取得するにはどうすればよいですか?
次の vbs コードを例にとると、1 つの関数、1 つのプロシージャ、2 つのステートメントが含まれています。関数とプロシージャ名を取得したい: 1)" GetValue " 2) " ABC_Result "
Microsoft によって提供されていIScriptControl::AddCode
ますが、問題は常にステートメント (「ABC_Result 20」、「While True 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