2005-08-19 Satya Sudha K <ksathyasudha@novell.com>
[mono.git] / mcs / class / Microsoft.VisualBasic / Test / standalone / 6879.vb
1   '
2   ' Copyright (c) 2002-2003 Mainsoft Corporation.
3   '
4   ' Permission is hereby granted, free of charge, to any person obtaining a
5   ' copy of this software and associated documentation files (the "Software"),
6   ' to deal in the Software without restriction, including without limitation
7   ' the rights to use, copy, modify, merge, publish, distribute, sublicense,
8   ' and/or sell copies of the Software, and to permit persons to whom the
9   ' Software is furnished to do so, subject to the following conditions:
10   ' 
11   ' The above copyright notice and this permission notice shall be included in
12   ' all copies or substantial portions of the Software.
13   ' 
14   ' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   ' IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   ' FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   ' AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   ' LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19   ' FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20   ' DEALINGS IN THE SOFTWARE.
21   '
22 Imports Microsoft.VisualBasic
23 Public Class TestClass
24     Public Function Test() As String
25         Dim fn As Integer
26         Dim strFileName As String
27         Dim strPathName As String
28         
29         '// make sure all files are closed
30         Microsoft.VisualBasic.FileSystem.Reset()
31         Dim oDT1_1(3) As String
32         Dim oDT1_2(3) As String
33         Dim oDT2_1 As Boolean = True
34         Dim oDT2_2 As Boolean
35         Dim oDT3_1 As Byte = 1
36         Dim oDT3_2 As Byte
37         Dim oDT4_1 As Short = 100
38         Dim oDT4_2 As Short
39         Dim oDT5_1 As Integer = 1000
40         Dim oDT5_2 As Integer
41         Dim oDT6_1 As Long = 100000
42         Dim oDT6_2 As Long
43         Dim oDT7_1 As Char = "c"c
44         Dim oDT7_2 As Char
45         Dim oDT8_1 As Single = 2.2
46         Dim oDT8_2 As Single
47         Dim oDT9_1 As Double = 8.8
48         Dim oDT9_2 As Double
49         Dim oDT10_1 As Decimal = 10000000
50         Dim oDT10_2 As Decimal
51         Dim oDT11_1 As String = "zzz"
52         Dim oDT11_2 As String
53         Dim oDT12_1 As Date = #5/31/1993#
54         Dim oDT12_2 As Date
55         Dim strin As String
56         oDT1_1(0) = "abc"
57         oDT1_1(1) = "def"
58         oDT1_1(2) = "ghi"
59         oDT1_1(3) = "jkl"
60         strPathName = System.IO.Directory.GetCurrentDirectory() + "/data/"
61         strFileName = "6879.txt"
62         'if this file exists - kill it
63         If (strFileName = Dir(strPathName & strFileName)) Then
64             Kill(strPathName & strFileName)
65         End If
66         ' Write text to file.
67         fn = FreeFile()
68         FileOpen(fn, strPathName & strFileName, OpenMode.Output)
69         Print(fn, oDT1_1)
70         Print(fn, oDT2_1)
71         Print(fn, oDT3_1)
72         Print(fn, oDT4_1)
73         Print(fn, oDT5_1)
74         Print(fn, oDT6_1)
75         Print(fn, oDT7_1)
76         Print(fn, oDT8_1)
77         Print(fn, oDT9_1)
78         Print(fn, oDT10_1)
79         Print(fn, oDT11_1)
80         Print(fn, oDT12_1)
81         FileClose(fn)
82         ' Input text from a file.
83         fn = FreeFile()
84         FileOpen(fn, strPathName & strFileName, OpenMode.Binary)
85         strin = Space(1000)
86         FileGet(fn, strin)
87         FileClose(fn)
88         If strin <> "abc           def           ghi           jklTrue 1  100  1000  100000 c 2.2  8.8  10000000 zzz31/05/1993 " Then Return "failed"
89         Return "success"
90     End Function
91 End Class