-----Original Message-----
I will try.
I just have a simple form that does calculations when you
input values and push buttons. One thing I am trying to
do is open and read a file when the form opens. So I
have a Private Sub Form1_Load subroutine. The code looks
like below ...
anyway it seems to go ok walking to the line
RBAirspeedMach.Checked = True
then it walks through some of the comments as if it was
executing them. I notice in the debug window that it is
actually performing the sr.Readline() but the pointer is
on the comment line
' Console.WriteLine("{0} ....
So I cannot really keep track of what line is executing.
Another queer thing. Its just read a line from the file
and displays the line in the debug window, so I think the
sr.Readline() executed. But when I put the mouse over
the variable inputln it shows me
Dim inputln As String
Whats up with that ?
Thanks for any help again
Bob
code snippet
Private Sub Form1_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
Dim inputln As String
'Dim riou As New Regex("^(?<numrtr>\d+\.\d+[eE]?
[+ -]?(\d+)?.+?<dentr>\d+\.\d+[eE]?\d+[:Wh]+(?
<outunits>.+$", _
' RegexOptions.Compiled)
Dim riou As New Regex("^(?<numrtr>\d+\.\d+[eE]?
[+ -]?(\d+)?.+?<dentr>\d+\.\d+[eE]?\d+[:Wh]+(?
<outunits>.+$")
Dim ipmode As String
Dim count_hi, count_speed, count_alt, count_ram,
count_temp As Integer
Dim units_typ_io_count(4, 2, 0) As Double
' open file if exists, create if not, for
read/write, allow others only read while open
Dim fs As New FileStream(FILE_NAME,
FileMode.OpenOrCreate, FileAccess.ReadWrite,
FileShare.Read)
fs.Close()
Dim sr As New StreamReader(fs)
' set defaults
RBAltitudeFeet.Checked = True
RBAirspeedMach.Checked = True
' overload units conversion file data if it
exists and is readable
' file expected in same dir as where the exe is
located
' should not need snippet below. the fs line
above should create if does
' not exist
' If Not File.Exists(FILE_NAME) Then
' Console.WriteLine("{0} does not exist! Using
Default Units.", FILE_NAME)
' MsgBox(FILE_NAME & " does not exist !")
' GoTo LastLine
' End If
' sr = File.OpenRead(FILE_NAME)
inputln = sr.ReadLine()
While Not inputln Is Nothing
' while not eof - is above appropriate check ?
' end of input stream should return nothing
' but what about a blank line ?
....
-----Original Message-----
Could you give us some information about how to reproduce your problem?
--
HTH,
-- Tom Spink, Über Geek
Please respond to the newsgroup,
so all can benefit
.
.