I'm stuck up with this code...How do I access the sContents variable in loadBoard() sub to LoadTable() sub
here is the code that might be useful....
any help would be appreciated...
here is the code that might be useful....
VB.NET:
Sub loadBoard()
Dim oFile As FileStream
Dim oReader As StreamReader = Nothing
Dim sContents As String
Dim count As Integer = 0
Try
oFile = New FileStream("some/path/to/the/text/file", FileMode.Open, FileAccess.Read)
oReader = New StreamReader(oFile)
sContents = oReader.ReadToEnd
Catch ex As Exception
sContents = ex.Message
Finally
If oReader IsNot Nothing Then
oReader.Close()
End If
End Try
Console.WriteLine(sContents)
End Sub
Sub Loadtable(ByRef Name() As String, ByRef Id() As Integer, ByRef Phone() As Integer, ByRef Connect() As Double, ByRef sContents As String, ByRef norows As Integer)
Dim temp1 As Integer
Dim temp2 As Double
Dim no As Integer = 0
Do While sContents <> "0" And no <= max
Name(no) = sContents
sContents = Console.ReadLine()
temp1 = Integer.Parse(sContents)
Id(no) = temp1
Console.WriteLine("id:", Id(no))
sContents = Console.ReadLine()
temp1 = Integer.Parse(sContents)
Phone(no) = temp1
sContents = Console.ReadLine()
temp2 = Double.Parse(sContents)
Connect(no) = temp2
no += 1
Loop
norows = no
End Sub
any help would be appreciated...
Last edited by a moderator: