[添付ファイル一覧]
[全ページの添付ファイル一覧]
- open_jdk_apidoc.vbs
- 格納ファイル名:attach/4D6163726F2FC5EAB9C62F313432_6F70656E5F6A646B5F617069646F632E766273
- ページ:Macro/投稿/142
- 格納ファイル名:attach/4D6163726F2FC5EAB9C62F313432_6F70656E5F6A646B5F617069646F632E766273
- MD5ハッシュ値:b67ae6532ab58981cd1d2ca981468b18
- サイズ:4.4KB (4509 bytes)
- Content-type:application/octet-stream
- 登録日時:2006/07/30 17:20:25
- アクセス数:434
- MD5ハッシュ値:b67ae6532ab58981cd1d2ca981468b18
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
| |
Const baseDir = "C:\j2sdk1.4.2\j2sdk-1_4_0-doc-ja\docs\ja\api\"
sWord = Editor.ExpandParameter("$C")
Const ForReading = 1, ForWriting = 2
Set wshShell = CreateObject("WScript.Shell")
Set fileSystem = CreateObject("Scripting.FileSystemObject")
indexFilePath = baseDir & "allclasses-frame.html"
Set indexFile = fileSystem.OpenTextFile(indexFilePath,ForReading)
Set lineRegExp = New RegExp
lineRegExp.Pattern = ">" & sWord & "(</I>)?</A>"
lineRegExp.IgnoreCase = False
lineRegExp.Global = True
Set pathRegExp = New RegExp
pathRegExp.Pattern = "HREF=.*.html"
pathRegExp.IgnoreCase = False
pathRegExp.Global = True
Dim resultArray()
Redim resultArray(0)
Do Until indexFile.atEndOfStream
line = indexFile.ReadLine
Set lineMatches = lineRegExp.Execute(line)
if lineMatches.Count <> 0 Then
Set pathMatches = pathRegExp.Execute(line)
resultIndex = UBound(resultArray) + 1
Redim Preserve resultArray(resultIndex)
resultArray(resultIndex) = Mid(pathMatches.Item(0),7)
End If
Loop
indexFile.Close
Set fromSlashRegExp = New RegExp
fromSlashRegExp.Pattern = "/"
fromSlashRegExp.Global = True
If UBound(resultArray) = 0 Then
wshShell.Popup "[" & sWord &"]は見つかりませんでした。" _
,0 ,"エラー" ,0
ElseIf UBound(resultArray) = 1 Then
filePath = baseDir & resultArray(1)
filePath = fromSlashRegExp.Replace(filePath,"\")
wshShell.Run(filePath)
Else
tempFilePath = wshShell.ExpandEnvironmentStrings("%TEMP%") _
& "\jdk_api_temp_menu.html"
fileSystem.CreateTextFile(tempFilePath)
Set tempFile = fileSystem.OpenTextFile(tempFilePath,ForWriting)
tempFile.WriteLine "<html><body>"
tempFile.WriteLine "<title>JDK API 検索結果 " _
& "キーワード:[" & sWord &"]</title>"
tempFile.WriteLine "[" & sWord &"]は" & UBound(resultArray) _
& "件見つかりました。<br/>"
For I=1 To UBound(resultArray)
filePath = baseDir & resultArray(I)
filePath = fromSlashRegExp.Replace(filePath,"\")
classPath = Left(resultArray(I),Len(resultArray(I))-5)
classPath = fromSlashRegExp.Replace(classPath,".")
tempFile.WriteLine "<a href=""" & filePath & """>" _
& classPath & "</a><br/>"
Next
tempFile.WriteLine "</body></html>"
tempFile.Close
wshShell.Run(tempFilePath)
fileSystem.DeleteFile(tempFilePath)
End If
|