質問編集履歴
4
コード修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -20,9 +20,9 @@
|
|
20
20
|
```vbs
|
21
21
|
Dim temp()
|
22
22
|
Set regEx = CreateObject("VBScript.RegExp")
|
23
|
+
regEx.Pattern = testPattern
|
23
24
|
|
24
25
|
For Each test In fso.GetFolder(FolderPath).Files
|
25
|
-
regEx.Pattern = testPattern
|
26
26
|
If regEx.Test(test.Name) Then
|
27
27
|
ReDim Preserve tmp(1 To i)
|
28
28
|
Set tmp(i) = f
|
3
コードがまちがってた
test
CHANGED
File without changes
|
test
CHANGED
@@ -21,9 +21,9 @@
|
|
21
21
|
Dim temp()
|
22
22
|
Set regEx = CreateObject("VBScript.RegExp")
|
23
23
|
|
24
|
-
For Each
|
24
|
+
For Each test In fso.GetFolder(FolderPath).Files
|
25
25
|
regEx.Pattern = testPattern
|
26
|
-
If regEx.Test(testName) Then
|
26
|
+
If regEx.Test(test.Name) Then
|
27
27
|
ReDim Preserve tmp(1 To i)
|
28
28
|
Set tmp(i) = f
|
29
29
|
i = i + 1
|
2
インデントがおかしい
test
CHANGED
File without changes
|
test
CHANGED
@@ -19,16 +19,15 @@
|
|
19
19
|
|
20
20
|
```vbs
|
21
21
|
Dim temp()
|
22
|
+
Set regEx = CreateObject("VBScript.RegExp")
|
22
23
|
|
23
24
|
For Each f In fso.GetFolder(FolderPath).Files
|
24
|
-
Set regEx = CreateObject("VBScript.RegExp")
|
25
|
-
|
25
|
+
regEx.Pattern = testPattern
|
26
|
-
|
27
|
-
|
26
|
+
If regEx.Test(testName) Then
|
28
|
-
|
27
|
+
ReDim Preserve tmp(1 To i)
|
29
|
-
|
28
|
+
Set tmp(i) = f
|
30
|
-
|
29
|
+
i = i + 1
|
31
|
-
|
30
|
+
End If
|
32
31
|
Next
|
33
32
|
```
|
34
33
|
|
1
スペルミス
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
### 実現したいこと
|
2
2
|
|
3
3
|
VBAで動いていたコードをVBSに移行するのに悩んでいます。
|
4
|
-
下記のコード、Likeが使えなくてRe
|
4
|
+
下記のコード、Likeが使えなくてRegExpを利用したところですが
|
5
5
|
そもそも下記の「ReDim Preserve tmp(1 To i)の行で
|
6
6
|
コンパイルエラーが出ます
|
7
7
|
具体的には「)がありません」とのこと
|