%
Option Explicit
Sub Main
ShowFileList
If Len(Request.Form("filename")) > 0 then
ShowDocs
End If
End Sub
Sub ShowFileList
%>
Select File
<%
End Sub
Sub ShowDocs
dim fso : set fso = Server.CreateObject("Scripting.FileSystemObject")
dim path : path = fso.GetFolder(Server.MapPath(".")).Path
dim file : set file = fso.OpenTextFile(path & "\" & Request.Form("filename"))
dim re : set re = new RegExp
With re
.Pattern = "Public Property|Public Sub|Public Function"
.Global = true
.IgnoreCase = true
End With
dim line, matches, result
Do Until file.AtEndOfStream
line = file.ReadLine()
set matches = re.Execute(line)
If matches.Count > 0 then
result = line
result = Replace(result, "Public Property", "Property")
result = Replace(result, "Public Sub", "Sub")
result = Replace(result, "Public Function", "Function")
response.write "" & result & "
"
End If
Loop
End Sub
%>
<% Call Main %>