nQiuRRfoQtXXAonhkjkzJ changeset

Changeset623864623064 (b)
ParentNone (a)
ab
0+Option Explicit
0+
0+Main
0+
0+Sub Main()
0+        Const ForReading = 1
0+
0+        Dim List
0+        Set List = Nothing
0+       
0+        Dim FileSystem
0+        Set FileSystem = CreateObject("Scripting.FileSystemObject")
0+       
0+        Dim TextStream
0+        Set TextStream = FileSystem.OpenTextFile("hoge.log", ForReading)
0+       
0+        Do Until TextStream.AtEndOfStream
0+                Set List = New ClassList.Init(TextStream.ReadLine(), List)
0+        Loop
0+       
0+        Do Until List Is Nothing
0+                WScript.StdOut.WriteLine List.Value
0+                Set List = List.NextList
0+        Loop
0+End Sub
0+
0+Class ClassList
0+        Public Value
0+        Public NextList
0+       
0+        Public Function Init(Value_, NextList_)
0+                Value = Value_
0+                Set NextList = NextList_
0+                Set Init = Me
0+        End Function
0+End Class
...
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
--- Revision None
+++ Revision 623864623064
@@ -0,0 +1,36 @@
+Option Explicit
+
+Main
+
+Sub Main()
+ Const ForReading = 1
+
+ Dim List
+ Set List = Nothing
+
+ Dim FileSystem
+ Set FileSystem = CreateObject("Scripting.FileSystemObject")
+
+ Dim TextStream
+ Set TextStream = FileSystem.OpenTextFile("hoge.log", ForReading)
+
+ Do Until TextStream.AtEndOfStream
+ Set List = New ClassList.Init(TextStream.ReadLine(), List)
+ Loop
+
+ Do Until List Is Nothing
+ WScript.StdOut.WriteLine List.Value
+ Set List = List.NextList
+ Loop
+End Sub
+
+Class ClassList
+ Public Value
+ Public NextList
+
+ Public Function Init(Value_, NextList_)
+ Value = Value_
+ Set NextList = NextList_
+ Set Init = Me
+ End Function
+End Class